on 09-19-2007 1:03 PM
Hi all,
How to close the pop up window without having its refrence and then taking control back to the parent window.Please reply in detail
hi amit,
If you know ur window name , then you can access it using following code and use distryinstance() function to destry the window. After it will get destryed the control will itself go to the window through which it had been launched.you can use following code.
IWDWindowInfo windowInfo = (IWDWindowInfo)WdComponentAPI.getComponentInfo().findInWindows("ur window name"); IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
window.destroyInstance();
I think this wud have answered ur question.
thanks
reena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/dialog%20boxes%20in%20web%20dynpro%20applications.pdf">Try this Tutorial</a>
Regards
Chaitanya.A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit,
Follow the steps.
Step1: Create a WD Component.
Step2: Under Component Controller create a Value Node EmployeeInfo with attribute EmployeeName and Position and a context attribute WindowInstance of type com.sap.tc.webdynpro.services.session.api.IWDWindow
Step3: Create 2 Views
i>EmployeeView
Layout like
-
Employee Name : EmployeeInfo.EmployeeName(InputField)
Employee Position : EmployeeInfo.Position(InputField)
DisplayResultButton
ii>DisplayView
Layout like
-
Employee Name : EmployeeInfo.EmployeeName(TextView)
Employee Position : EmployeeInfo.Position(TextView)
CloseWindowButton
Step3: Create 2 Windows
1>EmployeeWindow
2>DisplayWindow.
Under EmployeeWindow add the EmployeeView
and DisplayWindow add the DisplayView
Step3: Go to the Diagram View. Do the mapping between EmployeeView and Component Controller and between DisplayView and Component Controller
Step4: Associate action DisplayResult with the DisplayResultButton and use this code inside the Implementation of EmployeeView
public void wdDoInit()
{
//@@begin wdDoInit()
wdContext.nodeEmployeeInfo().addElement(wdContext.createEmployeeInfoElement());
//@@end
}
public void onActionDisplayResult(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionDisplayResult(ServerEvent)
IPrivateEmploeeView.IEmployeeInfoElement emp = wdContext.createEmployeeInfoElement();
emp.setEmployeeName(wdContext.currentEmployeeInfoElement().getEmployeeName());
emp.setPosition(wdContext.currentEmployeeInfoElement().getPosition());
wdContext.nodeEmployeeInfo().addElement(emp);
IWDWindowInfo windowInfo =(IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows(
"DisplayWindow");
// create the Window
IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo, true);
window.setWindowPosition(WDWindowPos.CENTER);
window.setTitle("WindowTitle");
window.setWindowSize(100,100);
// Save WindowInstance in Context
wdContext.currentContextElement().setWindowInstance(window);
// and show the window
window.show();
//wdThis.wdFirePlugInDisplay();
//@@end
}
Step5: Associate action CloseWindow with the CloseWindowButton
and use this code inside implementation of DisplayView
public void onActionCloseWindow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionCloseWindow(ServerEvent)
IWDWindow window = wdContext.currentContextElement().getWindowInstance();
window.destroyInstance();
//@@end
}
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit,
Create one context attribute of the type "com.sap.tc.webdynpro.services.session.api.IWDWindow".
The action from which you open the pop up window ,set this context attribute to the window object that you have created for your popup window.
Now,
You need to create button on the pop window say close.
And action of close button get the ,
Just write the following
IWDWindow window=wdContext.currentContextElement().getPopUpclose();
where PopUpclose-the context attribute that you have created of window type.
window.destroyInstance();
It will solve your problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need the reference to the popup window. Store it in the context for example.
Then to close it just execute this:
popupInstance.destroyInstance();
The popup will be closed and the parent window will be displayed again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.