Show TOC Start of Content Area

Background documentation Controllers  Locate the document in its SAP Library structure

Definition

Controllers are the active parts of a Web Dynpro Component. In the design of Web Dynpro Controllers, SAP has made a slight modification to the original MVC concept of a controller.

Note

In broad terms, there are two categories of Web Dynpro Controller. The difference between them is simply this:

     The controller has a visual interface, or

     The controller does not have a visual interface.

SAP has introduced this difference in order to maintain a strict separation between those parts of the business application that display data (typically data consumers), and those parts of the business application that process data (typically data generators).

Controllers having no visual interface

The red ellipses below show the controllers in a Web Dynpro Component that have no visual interface. As is to be expected, all these controllers are located entirely on the “Programmatic Entities” side of the diagram.

This graphic is explained in the accompanying text

Controllers that have no visual interface are generically known as custom controllers. At a basic level, the component controller and the interface controller can be thought special cases of custom controllers.

Controllers having a visual interface

The red ellipses show the controllers in a Web Dynpro Component that have a visual interface. These controllers span both the “Visual Entities” and “Programmatic Entities” sides of the diagram.

This graphic is explained in the accompanying text

Adding your own coding to a Web Dynpro Controller

All Web Dynpro components and their constituent controllers are created as a result of design time declarations. Once these declarations have been made, the Web Dynpro developer is free to add their own coding at predefined locations.

All Web Dynpro controllers have a well defined Application Programming Interface (API). This API comprises a static part that can always be assumed to be present, but it also has a variable part that is generated in response to design time declarations.

Whenever you wish to implement your own functionality within a Web Dynpro Controller, it can only be done at predefined locations in the source code. These locations are identified with special comment markers. Any attempt to enter source code outside these comment markers will result in the loss of that code. If any custom coding that has been entered outside the designated areas, somehow manages to survive the regeneration process, then it places the deployed application outside of SAP’s standard support agreement.

You can enter source code to implement functionality in the following areas:

     Standard lifecycle hook methods that control the initialization and end-of-life of controller instances.

     Standard round-trip hook methods that perform controller specific tasks.

     Custom written event handlers that respond to specific user actions on the client.

     Custom controllers that encapsulate some reusable unit of functionality.

     Rebuilding data held in the controller’s context.

     Etc…

 

End of Content Area