cancel
Showing results for 
Search instead for 
Did you mean: 

how to close Portal Window

vikas_saxena3
Participant
0 Kudos

Hi,

I'm opening my iVew as "Display in seperate Window" and this iView has one close button.

Once I click on this button, the full browser window should be closed.

I have done like this:-

First created an html file (Say close.html) inside Project\src\mimes\Components\package with contents

<html>

<head>

<script langauage="javascript">

function closeWindow()

{

var currWindow = window.top;

currWindow.opener = window.top;

currWindow.close();

}

</script>

</head>

<body onload="javascript:closeWindow()">

</body>

</html>

Now open InterfaceViews-><ViewName>InterfaceView

Create an Exit outboundplug with parameter Url(use the same name in the scenario) of type String. Save all metadata.

Inside the closeAction, written following code

String url=WDURLGenerator.getWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"Close.html");

wdThis.wdGet<ViewName>InterfaceViewController().wdFirePlugCloseWindow(url);

This is working fine with simple Web Dynpro App but once I deployed this as a iView in the portal and opened as "Display in seperate Window" than this code is not working for me.

Can anybody suggest how can I close my portal window?

Thanks,

Vikas

Message was edited by:

Vikas Saxena

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member185029
Active Contributor
0 Kudos

Hi,

Have you tried window.parent.close() ?

Ashu

vikas_saxena3
Participant
0 Kudos

Hi Ashu,

I have tried the same..but same problem exist and opened Portal window is not closing only the content area is closing as earlier,

Regards,

Vikas

former_member185029
Active Contributor
0 Kudos

May be u can try this

window.parent.opener.close();

Ashu

vikas_saxena3
Participant
0 Kudos

Same problem still there. mentioned code also didn't work for this case.

Vikas

former_member185029
Active Contributor
0 Kudos

hi

this worked for me

window.opener.close();

Ashu

vikas_saxena3
Participant
0 Kudos

Hi Ashu,

Have u followed the same approach for closing as I mentioned above?

And have u opened iView as "Display in Portal Window" mean is it opening as a new portal window?

if you code is different then could u plz share it with me since above is not working for me

Vikas

former_member185029
Active Contributor
0 Kudos

No,

What I did was to create 2 html files, parent.html and child.html

Parent html has following code


<SCRIPT LANGUAGE="JavaScript">
<!--
window.open("child.html");
//-->
</SCRIPT>

Child.html has following code

 <INPUT TYPE="button" value="Close" onClick="javascript:window.opener.close();javascript:window.close();">

Ashu

vikas_saxena3
Participant
0 Kudos

Hi Ashu,

My case is totally different and I don't have any child.

I just have one window that is configured as iView and I wanna close this.

Vikas

Former Member
0 Kudos

Hi,

You can try this:

1. In the portal create a URL iview and set the URL to the absolute URL of the HTML file that you have created. This URL will be in the following format:

http://<server>:<port>/webdynpro/resources/sap.com/<dc name/project name>/Components/<package name>.<component name>/<filename>.html

2. On click of the button do a portal navigation to this new iview like so:

WDPortalNavigation.navigateAbsolute
(
"ROLES://portal_content/<pcd path to URL iview>",
WDPortalNavigationMode.SHOW_INPLACE,
WDPortalNavigationHistoryMode.NO_HISTORY,
null				
);

Regards,

Satyajit.