cancel
Showing results for 
Search instead for 
Did you mean: 

Closing one popup window from another popup window

Former Member
0 Kudos

HI ,

How can i close on popup window from another popup window , both are called simulatanously on same action however i want to close one popup on click of cancel button on another popup window.

Rgds

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Akeel,

Try the following:

1.Create 2 attributes say Window1 and Window2 of the type IWDWindow in your component Controller, PopupView1 and PopuView2 for your two Popup windows.

2.Map the Window1 and Window2 attributes from the views to the same attributes in Component controller so that whenever you set those attributes inside the views, they get stored in the Component controller also. that way, if you set an attribute from Popoupview1, the value becomes available to PopuView2 via the Component Controller.

3. The code to op1n the popup will give you a IWDWindow object when you do something similar to

IWDWindow wind1 = wdComponentAPI.getWindowManager().CreateWindow(<parameters such as Window id>);
IWDWindow wind2 = wdComponentAPI.getWindowManager().CreateWindow(<parameters such as window id>);

4. You can store those IWDWindow objects in the above attributes in your Component controller

e.g.Something similar to

wdContext.currentContextElement().setWindow1(wind1);
          wdContext.currentContextElement().setWindow2(wind2);

5. After you have set these attributes in your Component controllerrough your views, you can access the references to those IWDWindow objects(references to the popup windows) them in your other popup view by accessing those context attributes from the Component Controller. Thatt means in your cancel button of your PopupView1, you can close the Popup window 2 as follows:

e.g. Something similar to

IWDWindow wind2 = wdContext.currentContextelement().getWindow2();
wind2.destroyWindow();

Regards,

Ajay

Former Member
0 Kudos

HI Ajay ,

this seems to be a good approach , but is there a way i can close the popup rendered first from the popup rendered second , however these both are trigered at the same action in the code one after the other only that i want to close the frist popup from the second popup

the above approach gives me the dump saying that popup 1 which i am trying to close from 2 sits on top of the stack

Rgds

Answers (2)

Answers (2)

Former Member
0 Kudos

thanks

Former Member
0 Kudos

is there a way i can close the popup rendered first from the popup rendered second , however these both are trigered at the same action in the code one after the other only that i want to close the frist popup from the second popup

the above approach gives me the dump saying that popup 1 which i am trying to close from 2 sits on top of the stack