on 04-27-2007 9:01 PM
Hi All,
I am using NW 2004s SP10 server. I want to close the browser window by clicking on a "Close Button". By going through other threads
I am using the below code in my Web Dyn Pro view.
String Url = WDURLGenerator.getWebResourceURL(wdComponentAPI.getDeployableObjectPart(),"exit.html");
if(!WDPortalUtils.isRunningInPortal()){
wdThis.wdGetSampleWindowInterfaceViewController().wdFirePlugClose(Url);
}else
{
WDPortalNavigation.navigateAbsolute(
Url,
WDPortalNavigationMode.SHOW_INPLACE,
(String) null,
(String) null,
WDPortalNavigationHistoryMode.NO_DUPLICATIONS,
(String) null,
(String) null,
(String) null,
true);
}
exit.html
<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>
Its working fine when I run the the application as Standalone. But when I run this on Portal, Its not working. I think problem is with
WDPortalNavigation.navigateAbsolute() method. Any good suggestions will be rewarded.
Thank you,
Sreekanth
Hi,
The <i>navigateAbsolute</i> method expects a PCD path of an iview as the URL, not anything else. So your passing the resource URL will not work.
You'll have to create an URL iview, maintain the resource URL as the URL property of this iview and then pass the PCD path to the <i>navigateAbsolute</i> method. Your code should look like:
WDPortalNavigation.navigateAbsolute(
"ROLES://<pcd path to the URL iview>",
.......):
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
<b>METHOD 1</b>
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())");
<b>METHOD 2</b>
1)WDClientUser.forceLogoffClientUser(<i>url</i>);
(<i>url</i> here cane be blank html page which closes itself <i>onLoad</i> or any other webpage you want )
for eg. WDClientUser.forceLogoffClientUser(close.html);
or WDClientUser.forceLogoffClientUser(www.sn.sap.com); etc
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I also faced the same problem.
In my requirement i was trying to open the generated URL in the same window but inspite of SHOW_INPLACE mode my window was being opened in a new browser window.
Try giving google.com as url ..see if it opens in a new window. Could be a bug. Plzz do correct me if i am wrong!
-Veena.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.