cancel
Showing results for 
Search instead for 
Did you mean: 

Close Web Dynpro Application on click of button

Former Member
0 Kudos
183

Hi,

I have a Web Dynpro Appliaction which would be open in a Portal iView. I have a close button in the application. How do I close the application on the click of "Close" button.

Thanks,

Prasanna.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

I am looking too for a button to close the browser window in a web dynpro application. The code, that you all posted above is very helpful, but I need it in ABAP. Is that possible? I am not expert in ABAP.

Thx a lot.

Ingmar

Former Member
0 Kudos

HI

1. Go to your Webdynpro component Interface View (<Your Webdynpro project> - WebDynpro - Web Dynpro Components - <your component> - Component Interface - Interface Views - <component>InterfaceView)

create a outbound plug (CloseWindow) of type exit with parameter "Url" as String

2. Go to your view controller and in the action to close the window

try{

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

wdThis.wdGet<your component>InterfaceViewController().wdFirePlugCloseWindow(Url);

}

catch(WDURLException WDURLe){

}

3. Create a html file with following content and place it in the src --> mimes --> Components --> <your component> -- > 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>

This code will close your present explorer window.

Former Member
0 Kudos

Hi Prasanna,

check this link,u get a clear idea for close button

Regards,

vino

Former Member
0 Kudos

Hi prasanna,

First, it is very bad decision to make decisions instead of user. Just redirect him to logoff page and let close window himself.

In WebDynpro you may use Exit plug on interface view with parameter Url (notice the case) of type string.

Then you may previously fire this plug with JavaScript url: javascript:void(window.top.close())

In recent versions of WD this will not work. So you have to redirect user via exit plug to some static html page, that contains in header <script>window.top.close();</script>

Check the below thread,u will get an solution for your question....