cancel
Showing results for 
Search instead for 
Did you mean: 

closing browser window via button

Former Member
0 Kudos

Hello,

I have a WebDynpro application running in a single Browser Window. Additionally to the 'x' in the upper right corner I need to provide a 'close' button that destroys the application and also the browser window. I'd appreciate any hint.

Lars

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Lars,

Well, this is possible with one limitation: user will see browser confirmation screen.

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())")

Valery

P.S. Disclaimer: personally, I hate "close browser" functionality

Former Member
0 Kudos

That was a cool script Valery

Former Member
0 Kudos

Hello All,

thanks a lot for your help. Valery, I'm on the same opinion, but it seems like the customer wants to have the "close browser" functionality.

Lars

Former Member
0 Kudos

Perhaps it's a version issue, but the javascript fix

above did not work for me as is. It resulted in an error "Not a valid URL" (or something similiar).

A work around is to place the javascript in it's own page containing only the following code:

<script language="JavaScript">

void(window.close());

</script>

Then use the url that references that page for your exit plug. In our case we called the page close.htm and placed it in our src/mimes/components folder (where you would place an image) and called it like so.

wdThis.wdMyWindowInterfaceViewController().wdFirePlugMyExit("../../../../webdynpro/resources/local/ProjectName/Components/com.company.whatever.ComponentControllerName/close.htm");

I'd also like to add that you need to go to the properties tab on your view and add the InterfaceView so you can reference the exit plug.

Lastly, regarding the concerns above about the pop-up box asking to close the browser... the pop-up does not appear when the application is called from the portal. This only occurs when the application is run separate from the portal.

Jeff

Former Member
0 Kudos

Hi,

I implemented this in my application. But I am getting the following error. Please let me know how to solve this.

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

***************************

Points will be awarded.

thanks in advance.

regards,

Raj.

kevin_maerz
Explorer
0 Kudos

Hi all!

Is this still working? Step 1 and 2 are fine but I am stuck at step 3:

How do I import the interfaceview exactly, in which package can be found usually?

Regards

Kevin

Former Member
0 Kudos

Hi Lars,

exiting an application is easy, you fire an outbound plug of type "exit". Closing the browser window from WD, as far as i know, no chance.

Regards

Stefan