cancel
Showing results for 
Search instead for 
Did you mean: 

How To Close External Window

Former Member
0 Kudos

Hi @ll,

i have one application which is displaying at portal content area. In that application there is a button which opens a another application in external window. Now my query is to how i could close that external window by clicking the Close Button of the 2nd application.

Please suggest.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member214651
Active Contributor
0 Kudos

Hi Goutam,

On click of Close button in the 2nd window write the following code:

<window object>.destoyInstance();

Regards,

Poojith MV

gautam_singh
Participant
0 Kudos

Hi Poojith,

I have already tried that one and still window is opened condition.

Former Member
0 Kudos

Hi,

Do you get any exceptions? Please confirm whether you destroy the window instance is same as the one to open the window

- Saravanan K

former_member214651
Active Contributor
0 Kudos

Hi Goutam,

Once you open the window from the 1st application are u storing the window context in the conponent controller?

Else you will not have the handle of the window and u cannot close it.

try this. on action of the element which opens the window, store the window context:

1. Create a context Attribute in the component controller

2. The type of the attribute of type IWDWindowContext under Java native type

3. Once you click on the button of the 2nd window, get the window context attribute in the 2nd window using the component controller

4. Close the window

Eg: -

Before opening First Window:

IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("<WindowName>");

IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);

wdContext.currentContextElement().set<AttributeName>(window);

window.show();

On Closing Second Window:

IWDWindow window = wdContext.currentContextElement().get<AttributeName>() {Bind the attribute to the controllers Attribute};

window.destroyInstance();

Hope this helps u.

Regards,

Poojith MV