on 07-24-2008 3:16 PM
Hi,
I've popup window but I'm not able to close this window. I've one button named "Close" so whenever i click on that button the popup window should get close.... for that i've used window.destroy, window.close, window. destroyinstance but none of them worked.
Even i've created seperate attribute named "closepopup"(com.sap.tc.webdynpro.services.session.api.IWDWindow) and tried but again stuk to the same problem.
Many times when I clik on the Close button it does nothing or it gives me null pointer exception.
The code....
IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("T_Number_Window");
IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
window.close();
Hi,
I think here:
WDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
window.close();
You are not closing the window instance u previously created, but a new one you are creating on the first line.
In order to open it properly, you should create it and save its instance so you can close it later. i.e.
To Open it
IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI .getComponentInfo().findInWindows("PopupWindow");
//Create Popup window
IWDWindow window = wdComponentAPI.getWindowManager().createWindow( windowInfo, true);
//Set window position on screen (pixels)
window.setWindowPosition(300, 150);
//Show it
window.open();
//Save window instance on context
wdContext.currentMyPopUpElement().setMyWindowInstance(window);
//Note im saving the instance of the window i just created, creating another one in order to try to close this one wont work
To close it
//Use the same instance previously saved on context
//Get popup instance and close it
IWDWindow window = wdContext.currentPopUpElement().getMyWindowInstance();
window.destroy();
Regards.
Julio C. Herrera
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 context of Java type IWDWindow in both views and map the context.
To Open Window
*****************
IWDWindowInfo info = wdComponentAPI.getComponentInfo().findInWindows("Popup");
IWDWindow wind = wdComponentAPI.getWindowManager().createModalWindow(info);
wind.setTitle("Value Help Window");
wind.setWindowPosition(150,150);
wind.setWindowSize(150,150);
wdContext.currentContextElement().setValueHelpWindow( wind);
wind.show();
********************************************************************
To Close Window
****************
IWDWindow windwow = (IWDWindow)wdContext.currentContextElement().getValueHelpWindow();
windwow.destroyInstance();
Mandeep Virk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
you implement close button functionality in componentcontroller.
IWDWindow popupwindow=wdContext.current<nodename>Element.get<Attributename>();
popupwindow.hide();
popupwindow.destryinstance();
call this method from popupwindow.
onActionClose(...)
{
wdThis.wdGet<compnentcontroller>.<methodname>();
}
Regards
sowmya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you passing the IWDWindow instance you create to the popup view in the context? This is the easiest way to close a popup. window.close() will do the trick if you are calling it on the correct instance.
-Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.