on 06-23-2008 9:14 AM
Hi all,
Do you know how to close the window when the user clicks on a button in web dynpro java?
Thanks for your answers.
Karim
Try this:
Create an attribute value ( say name : POPWindow ) of type IWDWindow in context both master view and child view and bind them.
While you create window, assign the window object to the context element
IWDWindow window = ......;
wdContext.currentContextElement().setPOPWindow( window);
in the close button action of the child view, put this code
wdContext.currentContextElement().getPOPWindow().destroyInstance();
note: Don;t forget to map the POPWindow attributes of both views;
Regards
Vinod V
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Declare two methods in ComponentContrroller
like openWindow() and closeWindow()
And in openWindow method write
String winName=<anotherWindowName>;
objWindow =
wdComponentAPI.getWindowManager().createModalWindow(
wdComponentAPI.getComponentInfo().findInWindows(strWindowName));
objWindow.setWindowSize(150,200);
objWindow.open();
Declare objWindow of type IWDWindow between
//@@begin others
//@@end
In closeWindow() method write
if(objWindow!=null)
{
objWindow.destroy();
objWindow=null;
}
On your button click just call these methods to open and close external windows like
wdThis.wdget<CompController>().closeWindow();
Regards
LN
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
From your post, I am assuming that you are opening a new window like a pop-up from the parent window and want to close it.
In this case, create a context attribute in the component ( or custom controller,if u have used any ) of type
com.sap.tc.webdynpro.services.session.api.IWDWindow
When you open the new window , set this attribute value to the name of this new window.
Now when you want to close this window on say , a click of a button, then simply access the attribute for window in component controller and use the property 'destroy' to closethe window.
Regards,
Sudeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if (wdContext.currentContextElement().getWindowcontext() != null)
{
wdContext.currentContextElement().getWindowcontext().close();
}
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 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.