cancel
Showing results for 
Search instead for 
Did you mean: 

close main application window in WD for Java

lajitha_menon
Contributor
0 Kudos

Hi there,

Is there anyway I can close the main application window(not popup) programatically.

I tried calling the exit plug in the interface view controller, but doesnt seem to close the window automatically.

I am having 2 components, one calling the other..

Any help will be greatly appreciated.

Many Thanks

lm

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi LM,

Check especialy Nibu`s suggestion.

<i>

1) In your Interface view, create an exit plug with a parameter Url of type string.

2) Add your Interface view controller to your current view's required controller. (in properties tab of your view)

3) After opening the new External window fire the outbound plug as :

wdThis.wdGet<your interface view controller>().wdFirePlug<your exit plug's name>("javascript:void(window.close())");

</i>

It should work for you.

Best regards, Maksim Rashchynski.

lajitha_menon
Contributor
0 Kudos

Hi Maksim,

Thanks a lot for that answer. Only slight issue is that in Internet explorer, it gives the popup saying that the application is trying to close the window - Do you want to close it?

Is there anyway to avoid that popup? I think there is no way, but just asked..

thanks,

lm

lajitha_menon
Contributor
0 Kudos

Hi,

I am referring to this previous thread which I had started, where I wanted to close the main application window.

All works fine using the method suggested(javascript window.close), but when the page is called from the portal using web dynpro iview, the page is not closed. It gives a blank screen, instead of closing it. This iview is being opened in a new window.

Any suggestions?

Thanks,

LM

Former Member
0 Kudos

L.M.,

Note, that later WD versions (I guess you are using not NW04s, and something lower then SP15) forbids such URL.

Better navigate via exit plug to some static HTML page with single line:

<html><body onload="window.close()">Application terminated</body></html>

Also there is no workaround for IE behavior as well as for other browsers. All of them show warning about closing "main" browser window.

VS

lajitha_menon
Contributor
0 Kudos

Hi VS,

Many Thanks for that answer. I will try it out,

Cheers,

LM

former_member182372
Active Contributor
0 Kudos

Hi LM,

In case of EP WD application is in frame. Try to pass "javascript:void(window.parent.close())" instead of "javascript:void(window.close())" as exit plug parameter.

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

<i>In case of EP WD application is in frame. Try to pass "javascript:void(window.parent.close())" instead of "javascript:void(window.close())" as exit plug parameter.</i>

Or even better "javascript:void(top.close())"

So it closes main window regardles of frames nesting.

VS

lajitha_menon
Contributor
0 Kudos

VS, Star!!

Thanks for that answer!

lajitha_menon
Contributor
0 Kudos

Hi VS, Maksim,

Sorry, I had to open this thread again. This is about closing the main application window.

The solution suggested by VS works , if there is only one component. But if this is being called by another component, and if the interface view of this comp is being called by the outbound plug of a view in another component, it errors, saying cannot exit embedded view.

Is there any way round this?

Many Thanks in advance,

LM

Former Member
0 Kudos

L.M.

Try WDClientUser.forceLogoffClientUser(url);

Should work from any nesting level of WD components.

VS

lajitha_menon
Contributor
0 Kudos

Hi VS,

Regarding your answer, I cannot force a log off, because he is still required to be logged in to the portal. If I use that method, it will log him off from the portal as well. I just want to close the current Application window(which is opened from the portal in a new window), even if there are nested embedded components used...

Thanks again, any suggestions are welcome,

cheers

LM

Former Member
0 Kudos

Hi L.M.

Have you solved this problem? I have the same requirement as yours. Any hints will be appreciated.

Thanks,

Zhu

Answers (0)