Entering content frame

Procedure documentation Creating a Custom Controller Locate the document in its SAP Library structure

A custom controller is a special type of controller of a Web Dynpro application, which the Web Dynpro application developer can create explicitly if required. Like all other controller types, the custom controller contains a context class, which is automatically generated when the custom controller is defined. Furthermore, the custom controller contains imported packages and methods that are then relevant to all classes in a Web Dynpro application. The custom controller is also the part of an application that implements the event handlers and validators that react to actions.

You can define more than one custom controller for a Web Dynpro application. Before starting the application, you use a reference to specify which custom controller is to be valid at runtime. The lifetime of a custom controller is linked to the lifetime of the entire Web Dynpro application.

Prerequisites

You have already created a Web Dynpro Project and a corresponding Web Dynpro Component.

Procedure

...

       1.      In the Web Dynpro Explorer, place the cursor on the node This graphic is explained in the accompanying textCustom Controllers (a subnode of the Web Dynpro component) and choose This graphic is explained in the accompanying textCreate Custom Controller in the context menu.

       2.      In the wizard, enter a name for the custom controller and close the wizard by choosing Finish.

Result

The logical element is displayed in the Web Dynpro Explorer. The Web Dynpro Generator creates the controller file <myCustomController>.wdcontroller in the file system. You can display this file, which contains both the Java source code and the XML description, in the Navigator view. Under no circumstances should you make any changes to this file.

Additional Information

Information on how to assign a custom controller to the Web Dynpro component and thus the application is available under Referencing a Custom Controller.

For information about editing a custom controller, refer to Editing a Custom Controller. The procedure for defining nodes and attributes for a custom controller is described under Context Structure.

 

Leaving content frame