Skip to Content
avatar image
Former Member

how to close Portal Window

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Sep 06, 2007 at 12:18 PM

    Hi,

    Have you tried window.parent.close() ?

    Ashu

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.