Show TOC

Adding Custom ControllersLocate this document in the navigation structure

Prerequisites

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.

  • 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.
    Note

    The steps above of adding a custom controller is available only in the classic capability of Web Dynpro. Users cannot add a custom controller manually in the non-classic capability.

Results

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.