on 07-16-2007 11:55 AM
Hi All expert,
After I run an application, an IE will be pop up. Is it possible that I create an Close button? Once I click on it, the window can be close. Please be remind that it is parent Window and not a pop up windows.
I try many of the thred suggest but none of them work for me.
Create Close.html/outboundPlug
This will generate an error.
com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Cannot navigate via outbound plug exitWeb of view ABCCompInterfaceView because there is no navigational link attached to it
2. Wdthis.WDGetcomponentInterveiewcontroller().WdFirePlugExit("javascript:void(window.close()");
Thanks,
Points will be reward for sure.
Yea, It is possible.
First create an html file (Say close.html) inside <b>Project\src\mimes\Components\package</b> 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 <b>Exit</b> outboundplug with parameter <b>Url</b>(use the same name in the scenario) of type String. Save all metadata.
Inside the closeAction, writhe following code
String url=WDURLGenerator.getWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"Close.html");
wdThis.wdGet<ViewName>InterfaceViewController().wdFirePlugCloseWindow(url);
Regards
Fahad Hamsa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For some reason, this doesn't work.
wdThis.wdGet<ViewName>InterfaceViewController().wdFirePlugCloseWindow(url);
It said resource navigator link not found.
Therefore, I use the moethod exist in other thread.
com.sap.tc.webdynpro.services.sal.um.api.WDClientUser.forceLogoffClientUser(Url);
and it work fine.
The rest of the step are the same.
1. Create Close.html
2. String url=WDURLGenerator.getWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"Close.html");
and use this
3. com.sap.tc.webdynpro.services.sal.um.api.WDClientUser.forceLogoffClientUser(Url);
as describe at Thread 3.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the above code will create a Logoff user from portal problem. Please use fowllowing code instead.
This can close the Window from Controller, and no Logoff from portal issue.
It doesn't need to create any outbound plug.
1. Create a Close.html. and it under the
src\mimes\Components\<Component package>\close.html
<html>
<head>
<script langauage="javascript">
function closeWin(){
window.close();
}
</script>\
</head>
<body onload="javascript:closeWin();"> </body></html>
2. Use the following code.
try{
String Url = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"close.html");
TaskBinder.getCurrentTask().getClient.sendRedirect(Url, 0);
}
catch (Exception e)
{
e.printStackTrace();
}
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.