on 07-07-2008 11:36 AM
Hi,
I need code for closing popupwindow.
I Have View1[FirstName,LastName]->Window1
I Have Another View2[Fname,Lname]->Window2.
I Have Component Controller [Fname,Lname] For Context Mapping From Both View1 And View2.
I Created Methods For OpenPopup And Close popup.
Open PopUp is Working Fine.After Open the Popup Window.
We Have Close Window Button.
What Code I Write Closing Popup Window.
Thanks
SubbaRao Chinta
Hi Subha,
If you want to close the popup window,you need to store window instance in component controller context and an simply call close(),destroy(),destroyInsatance() where ever you want to close pop up window.
Scenario:
If you have view where u r creating this popup window and want to close this through some button on popup window then map window instance context attribute between component controller to popup window'd view and call any of above given methos to close the pop up window.
I hope it would give you some understanding...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
try this code in closing that popup window button
wdThis
.wdGetKMComponentController()
.wdGetContext()
.currentContextElement()
.getFname()
.destroyInstance();
Hope this will help you
Regards,
Ramani.p
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
for closing popupwindow the following code will work.
IWDWindow popupwindow=wdContext.current<nodename>Element.get<attributename>.
popupwindow.hide();
popupwindow.destroyinstance();
here nodeattribute must bind to the IWDWindow type.
Regards
sowmya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
just write the lin of code
IWDwindow win;
win.close();
Thanks,
Tulasi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Hope the problem is solved..
Regards,
Arun.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please try this code. If every thing is mapped correctly your window will be close.
wdThis.wdGet<Name of Component>Controller().CloseWindow();
Regards,
Arun.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks For Quick Reply.
I Write Code In View2 For Calling Closing Window.
i created Methods in Componnet Controller.
public void OpenPopUp( )
{
IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("Window2");
IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
window.setWindowPosition (300, 150);
window.show();
}
I Want What Code For Closing PopupWindow.
public void ClosePopUp()
{
}
Please let Me Know ASAP.
Bye
Thanks
SubbaRao Chinta
if you want to close window in the popup itself, you need the current window instance to be passed. so create a value attribute (i call it as WindowInstance) in the context of type com.sap.tc.webdynpro.services.session.api.IWDWindow and pass it to the popup context.
public void OpenPopUp( )
{
IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("Window2");
IWDWindow window = (IWDWindow)wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
wdContext.current<Node>Element().setWindowInstance(window);
window.setWindowPosition (300, 150);
window.show();
}
And in the popup window you can close it using
public void ClosePopUp()
{
wdContext.current<Node>Element().getWindowInstance().destroyInstance();
}
WindowInstance is coming from parent window; so don't forget to map
nikhil
Store the pop-up window instance in a context attribute of the component controller, e.g. "popup" of type IWDWindow. Make this attribute available to the controllers that open and close the pop-up.
Create the popup-window on demand:
void openPopup()
{
IWDWindow popup = wdContext.currentContextElement().getPopup();
if (popup == null)
{
IWDWindowInfo windowInfo = (IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows("Window2");
popup = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
popup.setWindowPosition (300, 150);
wdContext.currentContextElement().setPopup(popup);
}
popup.show();
}
void closePopup()
{
wdContext.currentContextElement().getPopup().hide();
}
Armin
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.