cancel
Showing results for 
Search instead for 
Did you mean: 

How to close a popup window in a used component?

Former Member
0 Kudos

Hi Experts,

I have two applications in the same project, and they each have one component controller. Let they be component A and B. They have similar functionalities and screens. There is a popup window in A that I would like to use in B instead of creating a new popup window in B, so I added a used component of A in B in order to share the popup window. I am able to click a button in B to get a popup window from A successfully, but I am unable to close the popup window since the event has been created in A.

Can anyone suggest me how to fix this please? I would really appreciate your help.

Thanks,

-Napadol

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for both of your responses. The popup window cannot close (destroy) itself, so I didn't do window.destroy() under a close button. Instead, I created an event and a fire method in the interface controller and then created an event handler to destroy the window in the view of B. I then fire the method in the interface controller when I click a close button.

Former Member
0 Kudos

Hi Don,

You can set the newly created Pop up window under a context node's attribute of type IWDWindow in Views of Comp B and have same structure in Pop up view of Comp A and both interface controllers of A and B. Now using context mapping through interfaces you can have the Pop up window under context of Pop Up view. So, under close button of the Pop up,

just call window.destroy() and control is returned back to parent screen which is a view in Comp B.

Regards.

Tushar Sinha

Former Member
0 Kudos

Hi,

You can either use the approach above, which is having an Attribute, type IWDWindow in B's Component Context. When you open the popup you store the reference. When you click close you get that reference back and destroy the window.

Note, I'd suggest you to have your "View" with no Close Button. Then in Component A you create another View that has an UIViewContainer with your Popup View. You can code the Close code in Component A.

This way you can do the same and have a code in Component B to close your window.

Other way would be having it as a Component variable and using the Component Interface on A (create a Method) that goes to Component A and destroy that instance.

Regards,

Daniel