cancel
Showing results for 
Search instead for 
Did you mean: 

Close external window using Button

Former Member
0 Kudos

Hi all,

I have implemented a Web Dynpro application which runs in a portal. It opens in a separate browser window.

Now I have to implement a "close" functionality inside this application, which closes the window when the user clicks on a Button (or LinkToUrl -- never mind).

What would be the best way to implement this on NetWeaver 2004s?

Regards,

Martin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I've been using my solution for some time, and I would like to share it with you, I just can't seem to get the Post Message functionality in the forum to accept the text of my post! Even without markup!

Former Member
0 Kudos

just try to add your source without the <scrpt>-tags and even without the -tags... this might work

Else you could try to change e.g. window.close to wdw.clse or similar

Solutions are appreciated!

Thanks & Regards

Michael

Answers (5)

Answers (5)

Former Member
0 Kudos

I have a solution

Former Member
0 Kudos

Jennifer, thats great, thanks for your solution

I have one, too (maybe): Have a look at Matteos post, sounds as if it could work.

Regards

Michael

Former Member
0 Kudos

Hi

I face same problem

You have a solution to this?

Regards

Michael

Former Member
0 Kudos

I've already tried this, but i get an exception also. The Message is something like "You may not use exit plugs, use portal navigation instead!"

Thanks for any help.

Former Member
0 Kudos

Hi,

thanks for the answers.

I tried the above mentioned code, but it didn't work. It ends in an exception:

Cannot navigate from view ResidualLeaveWindowInterfaceView because it is not part of the current view assembly

My component has the following internal structure:

there are two applications and two windows. One application is displayed in an iView on an overview page, the other one is being called, when a link on the first iView is clicked (portal navigation). This opens a second browser window, where the real application gets executed inside. In this application there should be a link to close exactly this external window (The second browser window should close itself).

Maybe this helps you.

Regards,

Martin

snehal_kendre
Active Contributor
0 Kudos

HI,

In your real WD application, just create the exit plug in Interfaceviewcontroller of your main view.

and give it a parameter as url of string type.

snehal_kendre
Active Contributor
0 Kudos

HI,

You can use an external html file to close window.

Looks like your trying to close window from that window itself.

then create an close.html file and put it into mimes folder

access this file

String url = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"close.html");
wdThis.wdGetViewController().wdFirePlugExit(url);

in close.html write a javascript which contains following function

<html>
<SCRPT LANGUAGE='JavaScript'>
function win_close() 
{
 window.parent.opener = top;
 window.parent.close();
 window.opener.close();
}
</SCRPT>
<body onlod='javascript:win_close()'>
</body> 
</html>

snehal_kendre
Active Contributor
0 Kudos

You just need to make some changes in close.html

SCRPT to SCRIPT and onlod to onload.