on 09-06-2007 1:04 PM
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
Hi,
Have you tried window.parent.close() ?
Ashu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.