Show TOC Start of Content Area

Procedure documentation Stopping Applications  Locate the document in its SAP Library structure

There are three ways of terminating a Web Dynpro application:

      Triggering an exit plug from an interface view. When the application is stopped using the exit plug, the navigation controlled by the application is called one last time to display a user-defined last page.

      Executing a redirect when using an exit plug. In this case, the value of the application property LogoffURL must be passed as the parameter URL for the exit plug. Note that the user is not logged off when the Web Dynpro application is terminated by an exit plug call.

      Calling the method WDClientUser.forceLogoffClientUser(null). This method determines the Web address defined in LogoffURL and redirects the user to this address.The user is automatically logged off. If the application property LogOffURL is not defined, the logoff page predefined by Web Dynpro is displayed.

Prerequisites

Web Dynpro project, the required component with interface view as well as the view user interface units have been defined.

Procedure

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.      Goto 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

Note

When using predefined application properties, the name must be passed as the parameter that appears in the Application properties.

End of Content Area