Show TOC Start of Content Area

Procedure documentation Adding Custom Controllers  Locate the document in its SAP Library structure

A custom controller is a special type of controller of a WD application, which you create explicitly if required. Like all other controller types, the custom controller contains a context class, which is automatically generated when you define the custom controller. Furthermore, the custom controller contains imported packages and methods that are relevant to all classes in a WD application. The custom controller is also the responsible part of the WD application that implements the event handlers and validators that react to actions. You can define more than one custom controller for a WD application, and the lifetime of the custom controller is linked to the lifetime of the entire application.

Prerequisites

      Web Dynpro DC and WD component are available in Web Dynpro Explorer.

Procedure

...

       1.      In the Web Dynpro Explorer, place the cursor on the Custom Controllers subnode of the component and choose Create Custom Controller in the context menu. Follow the wizard for creating the controller.

       2.      To enable the custom controller for the application, you reference the custom controller starting from the component controller: Start the edit mode by double-clicking the component controller, choose the Properties tab, then Add. Finalize the wizard.

Result

The custom controller which is a logical unit of the WD application is displayed in the Web Dynpro Explorer, and the controller file <myCustomController>.wdcontroller has been created in the file system. You can display this file, which contains both the Java source code and the XML description, in the Navigator view.

More Information

Wrapping Services in Controllers

End of Content Area