on 04-12-2007 10:02 PM
Hi Orlando,
Do the following
1. First create a outbound plug of type exit say CloseWindow in your interface view controller with parameter Url of type string.
2. Create a html file say close.html with following code
<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>
Place this file in src/mimes/componenets/<Your component>/close.html
3. Add the interface view controller to your view controller.
In your view controller say u have created a action closeWindow.
In this acction method write code as below
try{
String Url = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"close.html");
wdThis.wdGet<Webdynpro Comp>InterfaceViewController().wdFirePlugCloseWindow(Url);
}
catch(WDURLException WDURLe){
}
This should work for u.
Reward points if helpful
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shriram,
I still got the same problem; I use the server log to print the value of
String Url = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"close.html");
Put the string in my browser and close my window as I want it to. But it didnt work in my wd app, it seems that my exit plug didnt redirect to the html file. Any idea of what could be wrong?
I put the code in an action inside my view and the action is assign to my button, I dont know if I should put it somewhere else, maybe in the interface view or anywhere else.
Regards,
Orlando Covault
Hi Sid,
In one of my previous post I said: "I use the server log to print the value of
String Url = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"close.html");(now I am using your jsp)
Put the string in my browser and close my window as I want it to. But it didnt work in my WD app, it seems that my exit plug didnt redirect to the html file."
And regarding the WD app shutting down, I known that the WD shuts down because I hit the button the first time and doesnt redirect but when I hit it for the second time I got this:
"The Web Dynpro Application 'MyWDApp' has expired. Please restart the application either with the refresh button or click the following link MyWDApp"
Regards,
Orlando Covault
The problem was that the parameter of the exit plug should be "Url"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Instead of create a html file, is it possible to use webdynpro class?
In a page, I have a Exit button, which will close a current open window.
So, I try to use IWDWindow.hide() but seems not really work.
By the way, how to search the example use by the class, e.g.IWDWindow.
Thanks all.
Hi Orlando,
First create a exit plug in your windowInterfaceController with a parameter "Url" of string type. After that create a jsp file say close.jsp in your mimes -> components -> under your package folder write this in your JSP.
<html>
<body onload=window.close()>
</body>
</html>
Now in your onAction of the button write following:
String URL = "";
try {
URL = WDURLGenerator.getWebResourceURL(wdComponentAPI.getDeployableObjectPart(), "close.jsp");
} catch (WDURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
wdThis.wdGetPortalppAppCompWindowInterfaceViewController().wdFirePlugExitToHTML(URL);
} catch (RuntimeException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
Do reward points if it helps.
Regards
Sid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
9 | |
9 | |
8 | |
7 | |
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.