on 06-18-2007 3:38 PM
Hi,
I am having a requirement in my web dynpro application, I need to put a link or button on the view and when I click on the button/link the window should get closed.
I implemented the following steps provided in the thread , but this doesn't helped me, it is throwing error.
steps
******
If this is OK for you, then do the following:
1. In InterfaceView create "Exit"-type outbound plug (you have to select "Exit" checkbox on creation). Let it name be MyExit.
2. Add parameter Url [string] to this plug (be careful, first letter should be capitalized)
3. Import InterfaceViewController in necessary view and implement closing action handler as following:
wdThis
.wdGetMyWindowInterfaceViewController()
.wdFirePlugMyExit("javascript:void(window.close())")
************
I am getting the following error.
ERROR
*********
While processing the current request, an exception occured which could not be handled by the application or the framework.
If the information contained on this page doesn't help you to find and correct the cause of the problem, please contact your system administrator. To facilitate analysis of the problem, keep a copy of this error page. Hint: Most browsers allow to select all content, copy it and then paste it into an empty document (e.g. email or simple text file).
Root Cause
The initial exception that caused the request to fail, was:
com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Cannot navigate from view IVACWindowInterfaceView via non-existent outbound plug AppExit
at com.sap.tc.webdynpro.progmodel.view.View.navigate(View.java:459)
at com.sap.xss.hr.cat.approve.vac.confirm.header.wdp.InternalIVACWindowInterfaceView.wdFirePlugAppExit(InternalIVACWindowInterfaceView.java:145)
at com.sap.xss.hr.cat.approve.vac.confirm.header.VcCatApproveConfirmHeaderView.onActionExit(VcCatApproveConfirmHeaderView.java:147)
at com.sap.xss.hr.cat.approve.vac.confirm.header.wdp.InternalVcCatApproveConfirmHeaderView.wdInvokeEventHandler(InternalVcCatApproveConfirmHeaderView.java:140)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
... 28 more
***************************
<b>Remember that my web dynpro application is a pop-up screen which gets generated when I click on any work item in UWL.</b>
Please let me know where I am wrong and provide me the solution.
Points will be awarded.
Thanks in advance.
Regards,
Raj.
Hi Raj,
Don't take any outbound plug.Your requirement is to close the current window. Just take a Button say Close in the view
And assign a action to that button sayCloseMain.
And put the code inside the action of the button
public void onActionCloseMain(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionCloseMain(ServerEvent)
try {
String Url = WDURLGenerator.getWebResourceURL (wdComponentAPI.getComponent().getDeployableObjectPart(),"close.html");
//wdComponentAPI.getMessageManager().reportSuccess("Url = "+Url);
//To close the application
//com.sap.tc.webdynpro.services.sal.um.api.WDClientUser.forceLogoffClientUser(null);
//To Close the Current Window
com.sap.tc.webdynpro.services.sal.um.api.WDClientUser.forceLogoffClientUser(Url);
} catch (WDURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//@@end
}
Steps to create close.html
-
Step 1: Go to the Navigator perspective .
Select Your Component(under src/mimes/components/<ur webdynpro component>
) right click =>New =>
Step2: A wizard will appear select "Simple" from left and "File" from the right
Then Click Next button.
Step3 : Give the "File Name" close.html and Finish .Close.html File will be created
Step4 : select the "source" tab and paste the code.
close.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>
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mithu,
I tried with your work around. The window is showing 'OK 200' message, but now I am facing one critical problem after implementing the work around, <b>the user is getting logged off from portal</b>, which is not at all acceptable.
Can you please let me any alternative for this problem?
Regards,
Raj.
I did this one for my leave request approval in UWL. Instead of launchiing the WebDynpro application directly, I am launching a PCD page. Which has got two iViews, the WebDynpro approval one and a faceless par based application which has got javascript to close the window. I have added a custom Exit button on the confirmation screen of my WD java application, which is raising an EPCM event. I am capturing this event in the par based iView and exceuting the java script to close the iView.
Hope it helps.
Thanks
Prashant
Hi,
create a html file (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 the file under src/mimes/components/<ur webdynpro component>/close.html
Now in you action to close the window
String Url = WDURLGenerator.getWebResourceURL (wdComponentAPI.getComponent().getDeployableObjectPart(),"close.html");
wdThis.wdGetMyWindowInterfaceViewController().wdFirePlugMyExit(Url);
}
catch(WDURLException WDURLe){
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Shriram,
I implemented your work around. Sorry to say that it doesn't helped me in solving the problem. It seems the error is something else.
After creating the Exit outbound plug for IVACWindowInterface, still It is throwing the following error. It seems it couldn't able to find the outbound plug.
<b>com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Cannot navigate from view IVACWindowInterfaceView via non-existent outbound plug AppExit</b>
Please let me know how to solve this.
As this is an urgent issue to be solved, I need any help at the earliest.
Points will be rewarded.
Thanks in advance.
Kind regards,
Raj.
Hi Raj,
Immediately paste your mail address here. I have a same project ready for you and it exactly matches your requirement. Just paste your mail address here and I will send you the application and a doc of how to impelement it in your application..
Thanks and Regard
Avijit Dhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
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.