on 04-23-2008 3:22 PM
Hi@all,
I want to click on a LinkToAction or a LinkToURL or something else, and open a new small view in a seperate Window. How should I do this.
Best regards
Marcus
- Create a window "PopupWindow" in the Web Dynpro Explorer and embed the view to display in the popup.
- Create a context attribute "popup" in the component controller to store the window reference.
In the view controller that opens the window:
- add a context attribute by mapping to component controller attribute "popup"
- add an action "OpenPopup" and in the action handler, write
void onActionOpenPopup(...)
{
IWDWindow popup = wdContext.currentContextElement().getPopup();
if (popup == null)
{
IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("PopupWindow");
popup = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
wdContext.currentContextElement().setPopup(popup);
}
popup.show();
}
In the controller of the view inside the popup window,
- add context attribute "popup" by mapping to component controller attribute
- add an action "ClosePopup" with action handler
- add a button or link to close the popup using action "ClosePopup"
void onClosePopup(...)
{
wdContext.currentContextElement().getPopup().hide();
}
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Armin,
thanks for your Reply.
There are following problems in the code:
public void onActionShowContacts(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionShowContacts(ServerEvent)
IWDWindow *popup* = wdContext.currentContextElement().getPopup();
if (popup == null)
{
IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("BaseActHomeStationContactWnd");
popup = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
wdContext.currentContextElement().*setPopup(popup)*;
}
popup.show();
In this code there are this problems:
Type mismatch: cannot convert from boolean to IWDWindow
(I also try it with string, what is my fault??)
The method setPopup(boolean) in the type IPrivatBaseActHomeStationBottomView.IContextElement is not is not applicable for the arguments (IWDWindow).
(I think this belongs to the first mistake)
&
for this code:
public void onActionCloseContact(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionCloseContact(ServerEvent)
wdContext.currentContextElement().getPopup().hide();
}
mistake: Cannot invoke hide() on the primitive type boolean
I thank you for Reply.
Best regards
Marcus
hi,
Hope u have created a new Window and have enbeded the view which u want to display in the new Window .
In the View (First view , from where u are going to call the New Window ) u have to create a context attribute with type as com.sap.tc.webdynpro.services.session.api.IWDWindow
here the Attribute is WindowInstance.
in the on action method of the link to action give the following code
IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("AddressbookWindow");
IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
//Assignning the window handle to a context variable for later use
wdContext.currentContextElement().setWindowInstance(window);
window.show();
}
thanks and regards,
Fistae
hi,
first create a new Window and embed the view which u want to display in the new window and finally use the Window Manager
Here u have to create a context attribute with type as com.sap.tc.webdynpro.services.session.api.IWDWindow
here the Attribute is WindowInstance.
in the on action method of the link to action give the following code
IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("AddressbookWindow");
IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
//Assignning the window handle to a context variable for later use
wdContext.currentContextElement().setWindowInstance(window);
window.show();
}
thanks and regards
Fistae
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
first create a new Window and embed the view which u want to display in the new window and finally use the Window Manager
in the on action method of the link to action give the following code
IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("AddressbookWindow");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.