Show TOC

Background documentationController Locate this document in the navigation structure

 

Controllers are the active parts of a Web Dynpro application. They determine how the user can interact with the Web Dynpro application. The data that a controller can access is defined in the corresponding context. Different instances of controllers and contexts exist within a Web Dynpro application. In addition to view controllers, which control the behavior of an individual view, there are also global controllers that offer more general services for all the views of a component.

 

View Controller

Each view has exactly one View Controller, which processes the actions performed by the user in the view. A view also has exactly one view context, which contains the data required for the view.

This graphic is explained in the accompanying text.

A view controller and the corresponding context exist at least as long as lthe view is visible in the browser. If the view is replaced by a successive view, the local data are also no longer available. However, the lifetime can also be connected to the lifetime of the surrounding component.

Caution Caution

A view may be visible in the technical sense as part of a view set (Web Dynpro Java), although its content on the screen may be, for example, a hidden tab in the background. In this case the view data is still available as before, and the view exists.

End of the caution.
Global Controllers

Each Web Dynpro component contains at least one global controller that is visible within the component for all other controllers. Once the data for this component controller have been created the first time they are accessed, the lifetime extends to cover the whole period during which the component is in use.

You can add additional global controllers in the form of custom controllers. These also last as long as the component and the data they contain are available to all views of the component.

Every time there is a Web Dynpro window, a further global controller (the Window controller) is added to the component.

This graphic is explained in the accompanying text.

Interface Controller

Each Web Dynpro component contains exactly one interface controller. This controller is a global controller that is visible also outside the component. It is thus part of the interface of a Web Dynpro component.

Communication from one controller to the next is achieved by calling methods from a different controller, or by triggering an event on which other controllers are already registered. You define these controller uses when you create a controller.

Source Text

Each controller contains program areas in which you can insert your own source code. Therefore, an Application Programming Interface (API) exists for the processing of context nodes and their attributes and data. The necessary initialization of nodes can also be executed using this API. There are further APIs available, for example, the server abstraction layer for accessing the system environment, and the APIs for message handling and dynamic programming.

Controllers can contain their own source code in the following areas:

  • Event Handler

    Event handlers are executed when a view is initialized, ended, or entered, when a user interface element of a view triggers an action, or when other controllers trigger a registered event.

  • Methods

    Methods can be called by other controllers.

  • Supply Functions

    Supply functions are executed when necessary to initialize elements in the context.