cancel
Showing results for 
Search instead for 
Did you mean: 

Open app url using createNonModalExternalWindow

Former Member
0 Kudos

Hi,

I open an application url using the below code.

IWDWindow win = wdComponentAPI.getWindowManager().createNonModalExternalWindow(urlToTargetApp,"External");

win.show();

New windows keep opeing as an when the action with above code is invoked.I need to restrict so that the already open window ( first time opened window) is used to launch subsequest url..

Any idea on how to do this..

Ashok

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

This behaviour cant be changed.ie they open in different windows each time.

sanyev
Active Participant
0 Kudos

Hi Ashok,

IWDWindow interface does not allow you to use the same window to go to another external website. You will have to destroy the existing window and open a new one.


IWDWindow win = wdContext.currentContextElement().getWindow();
if(win != null){
    win.destroyInstance() ;
}
win = wdComponentAPI.getWindowManager().createNonModalExternalWindow(urlToTargetApp,"External");
win.setWindowPosition(200, 200); 
win.show();
wdContext.currentContextElement().setWindow(win);

This will basically destroy the previous window and open a new window. At any point of time only one external window will be open.

Regards,

Sanyev

Former Member
0 Kudos

Hi Ashok,

Let me explain you further.

Say you have a method onClickOpenWindow() in which you have written the code for opening the window.

Now declare a boolean golbal variable say isWindowOpen =false;

Now in method onClickOpenWindow() make the boolean isWindowOpen= true;

now you have to wiite one condition like in method onClickOpenWindow()

if(isWindowOpen){
   window.close();
}

So by this will call the close window method only when the button is clicked means only when already a window is open.

Hope this will help.revert if you require more info

Regards

Narendra

Former Member
0 Kudos

Hi,

window.close is deprecated .

Also it does not solve the purpose.

Regards,

Ashok

Former Member
0 Kudos

Hi Ashok,

I think what you require is not possible.

But what you can do is in the method where you opne the new window write the code for closing the window.

So if the user clicks it one more time it will first close the window and then open new window.

Hope this will help.

Regards

Narendra