cancel
Showing results for 
Search instead for 
Did you mean: 

How to close the browser from webdynpro application

former_member192283
Participant
0 Kudos

Hi All,

I need to implement the closing the browser where the webdynpro application running by click on some button in that application.

Can any body tell me how to implement that.

Regards

Vijay

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

I resolved as follows(WebDynpro7.3) :

1.- Create a plug in the "Window" with the name "Exit" and parameter "closeWindow" the type Boolean, after edit it and put type Exit.

2.-Repeat the same but in the "Interface".

3.-Place the following code in the action:


  IWDWindowController iwdWindowController =wdControllerAPI.getWindowController();

  IWDWindowInfo windowInfo=iwdWindowController.getWindowInfo();

  IWDOutboundPlugInfo  iwdOutboundPlugInfo=windowInfo.findInOutboundPlugs("Exit");

  iwdWindowController.firePlug(iwdOutboundPlugInfo, new HashMap(){{put("closeWindow",true);}});

regards.

JCARMONA

Former Member
0 Kudos

Hi Jorge Carmona,

I am working on 7.3. I followed your approach to close the browser but it is not working.

Could you please help me.

Do we need to keep any html file in the mimes folder?

Regards

V. Suresh Kumar

ErvinSzolke
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

create an Exit Plug with an arbitary name (in the below example I called it closenow) and ensure it has a boolean parameter called closeWindow .

This is case sensitive, ensure the parameter is closeWindow!

Then create an action button on your Webdynrpo view, and invoke this code:

wdThis.wdGetCw2WindowController().wdFirePlugClosenow(true);

For this of course you have to have a data link from your webdynpro view to the webdynpro window (which is called in my example Cw2Window), then it will be visible from the view and the above code will work.

One pitfall is that once you created the exit plug on the interface view, it may report an error, but clicking on the Problems tab and selecting the error, in its context menu there is a quick Fix option that resolves the problem. Alternatively of course you can create the exit plug manually in the properties of the Window (tab Plugs).

I hope this helps.

Regards,
Ervin

Former Member
0 Kudos

Hi Ervin,

Thanks for your help. Its working now.

Regards

V. Suresh Kumar

Former Member
0 Kudos

Thanks !!

ErvinSzolke
Product and Topic Expert
Product and Topic Expert
0 Kudos

you are welcome

satish_kumar106
Explorer
0 Kudos

Hi Manoj,

Can you give me the javascript.Thanks.

Regards,

Satish S

Former Member
0 Kudos

Hi!

have you tried with WDPortalNavigation.navigateAbsolute method ....

Former Member
0 Kudos

Hi,

If your application is running stand-alone (not as a portal WD iview) then you can fire an exit plug on click of the button. The exit plug fire method expects an URL to redirect to and you can create a simple HTML file with the javascript to close the window and pass this URL to the exit plug.

If this is your case then search this forum for "javascript + close window" and you'll find a lot of threads.

However if your application is running in a portal then you cannot use exit plugs & the suggested method is to use portal navigation. But you cannot achieve this with portal navigation.

Regards,

Satyajit.

Former Member
0 Kudos

Hi

You can follow this procedure:

1.Create a Button called Exit.

2.Create an action for this button.

3. In the event handler for this button, write the following code:

String Url;

try {

Url = WDURLGenerator.getWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"close.html");

wdThis.wdGetAtpEmpDetailsWinInterfaceViewController().wdFirePlugExitPlug(Url);

} catch (Exception e) {

wdComponentAPI.getMessageManager().reportException("Technical Exception occured in the application : " + e.toString(), true);

}

4.Create a html page called u201Cclose.htmlu201D with Javascript code for closing a browser window.

5.Place this html page in SRC -> Mimes -> Components -> Project Structure(Create this folder and place the html page in this folder)

Hope this helps.

Regards,

Padmalatha.K

Former Member
0 Kudos

Hi Padma,

It worked. Kudos to you pal, your code is working. Thanks a lot.

Kind Regards,

Manoj Durairaj