cancel
Showing results for 
Search instead for 
Did you mean: 

Close the Browser which clicking Logoff Button

Former Member
0 Kudos

Hi,

I have requirement like this,

I have button Logoff. While clicking this button my webdynpro application must close i.e

it must close the browser.

I am using the following code

"com.sap.tc.webdynpro.services.sal.um.api.WDClientUser.forceLogoffClientUser("");".

But this code moves to some other screen and gives message "Webdtnpro applicaation is closed,bye".

Please help with the code and procedure to handle the Logoff.

Thanks,

Anitha.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

U should pass URL to exit from the browser.

Regards,

Sunaina Reddy T

Former Member
0 Kudos

Hi,

Thanks for ur inputs,

I tried with that code but, I am getting an run time error.

"Application error occurred during request processing.

Details: com.sap.tc.webdynpro.services.sal.core.DispatcherException: The requested deployable object 'sap.com/jvmobile' and application 'exit' are not deployed on the server. Please check the used URL for typos.

Exception id: [000180598396007E000000BE00000B6800044C64B56DDBAC]"

Please help me what type of value should be passed in application properties or

should pass URL to exit from the browser.

Thanks,

Anitha.

Former Member
0 Kudos

Hi,

The following steps describe how to terminate the application using an exit plug with a parameter defined for the URL. This procedure is recommended by SAP, because after the termination of a Web Dynpro application the user is not logged off when executing a Web Dynpro application on the NetWeaver Portal.

1. Define an exit plug in an interface view of your local component interface which is displayed in the Web Dynpro Explorer view. Either use the default interface view, or create a new one. Open the Controller Editor with its plugs, and create an exit plug within the outbound plug table (via New).

2. Follow the wizard, and enter the name Url for the parameter and select string as the type. This parameter is case-sensitive and must be entered exactly this way.

3. Go to your view, define an action with name Exit and use the default event handler named onActionExit().

4. In the view layout, define a button and bind its onAction event to the Exit action. To do so, start the View Designer on the view unit (Open ® Open View Editor, choose Layout tab).

5. Display Properties for the current view unit, and define usage of the Component Controller of your WD Component.

6. Switch to the view controller coding: Choose tab Methods, then press F3 on method name to start the editor with the implementation (.java file). Add the following method coding:

//@@begin onActionExit(ServerEvent)

String logoffURL = wdComponentAPI.getApplication().getApplicationInfo().findInApplicationProperties("sap.logoffURL").getValue();

wdThis.wdGetTimeCompInterfaceViewController().wdFirePlugExit(logoffURL);

//@@end

Or

Follow this procedure,

create a button and create an action exit.

in exit method write the following code

public void onActionexit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionexit(ServerEvent)

com.sap.tc.webdynpro.services.sal.um.api.WDClientUser.forceLogoffClientUser(null);

//@@end

}

Refer these threads also,

Regards,

sunaina Reddy T