on 07-14-2008 6:20 AM
Hi all,
i hv to close the window that appears on click of a button .
i hv a button 'close' in the popup window with the following code:
IWDWindowInfo win = wdComponentAPI.getComponentInfo().findInWindows("Address_Win");
IWDWindow window = wdComponentAPI.getWindowManager().createWindow(win,true);
window.destroy();
it shows no action..
can u plz tell me why is it so and what is the correct way to do it?
Thanks and Regards,
Ankita
hi ankita,
IWDWindowInfo win = wdComponentAPI.getComponentInfo().findInWindows("Address_Win");
IWDWindow window = wdComponentAPI.getWindowManager().createWindow(win,true);
window.destroy()
This code creates another window instance, it will not refer the current one. so can't be closed.
sol:
Create another attribute in the popwindow view and in master view of type(com.sap.tc.webdynpro.services.session.api.IWDWindow) IWDWindow (say CurrentWindowInstance) and pass that instance to popwinodow.
onAction create popup window
}
IWDWindowInfo win = wdComponentAPI.getComponentInfo().findInWindows("Address_Win");
IWDWindow window =(IWDWindow) wdComponentAPI.getWindowManager().createWindow(win,true);
wdContext.currentContextElement().setCurrentWindowInstance( window);
window.show();
now you can destory the current instance by
wdContext.currentContextElement().getCurrentWindowInstance().destroyInstance();
nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Create a Value Attribute of type com.sap.tc.webdynpro.services.session.api.IWDWindow in generating view ,popup views and Controller and map them accordingly.
Now on close action of popup view - use this code
IWDWindow win = wdContext.currentContextElement().getWindow();
win.destroy();
Regards,
Sunitha Hari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OnAction() close window write this code
wdContext.current<value node>Element().get<value attribute>().destroyInstance();
Where value attribute is of java type IWDWindow.
This is compete code for popup window
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
In component controller you create one method and variable like follows
i.e., close window, modalwindow.
//@@begin others
IWDWindow modalwindow;
//@@end
}
public void closewin( )
{
//@@begin closewin()
modalwindow.destroyInstance();
//@@end
}
and then call this method to specific button by follows
wdThis.wdGetJPopupCompController().closewin();
try this and let me know
Thanks ,
Tulasi.Palnati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OnAction() close window write this code
wdContext.current<value node>Element().get<value attribute>().destroyInstance();
Where value attribute is of java type IWDWindow.
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,
For this you need to have a context attribute of type IWDWindow. when you create the window just set the window instance to this attribute.
Say your attribute is "PopupWin". Now on close you can write:
IWDWindow win = wdContext.currentContextElement(),getPopupWin();
win.destroyInstance();
Just check the following link for further clarity:
thanks & regards,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.