Monday, January 13, 2014

TAW12 - WEB DYNPRO CONTROLLER

WEB DYNPRO APPLICATION: TYPES OF CONTROLLERS



Four main types of controllers exist in a Web Dynpro component:
  The Component controller drives the functionality of the entire component. It is a global controller; is visible to all other controllers; and has no visual interface.

  
Custom controllers are optional. They are defined at design time and are used to encapsulate sub-functions of the component controller. A component can have several defined custom controllers, which are instantiated automatically by the Web Dynpro framework.
The Configuration controller is a special custom controller. It is used for special configuration and personalization functions. A component can have only one configuration controller.


  The View controller handles the view-specific flow logic, such as checking user input and handling user actions. Each view comprises the layout and exactly one view controller.

  The Window controller handles the data passed through the inbound plugs when reused as a child controller. Each window has exactly one window controller. Its methods are also called from the inbound plug methods of the window.


CONSTITUENTS OF ALL CONTROLLERS



In the Web Dynpro framework, the Controller comprises Context, Attributes, Properties, and Methods.
The Context houses all the root nodes.
Attributes comprise Standard Attributes and Additional Attributes. Standard attributes may be of two predefined types: WD_THIS and WD_CONTEXT, which access the functionality of the controller and the context, respectively.
The Properties tab of a controller defines the sharing of information between different controllers. This is where usage declarations are stored. Any controller can get access to another only by using this tab.
The Methods tab is the repository for hook methods, which are a set of methods predefined in the Web Dynpro framework. All controller types have at least two hook methods, which are processed only once during the lifetime of a controller instance.
WDDOINIT( ) is processed when a controller instance is created and WDDOEXIT( ) when a controller instance is deleted.
The Methods tab also helps define Additional Methods.
Business Logic, such as function modules, BAPIs, or methods in helper classes, can be accessed from the methods of all controllers.

COMPONENT/CUSTOM CONTROLLERS: SPECIAL ENTITIES



You can create Events for component and custom controllers, and define them with the parameters of your choice.
You can register any method of any other controller, including view and window controllers, to the created events if the method is defined as an event handler one.
The component controller has three additional hook methods: WDDOBEFORENAVIGATION( ), WDDOPOSTPROCESSING( ), and WDDOAPPLICATIONSTATECHANGE( ).

VIEW CONTROLLERS: SPECIAL ENTITIES

An action links a client-side event, such as clicking a button in a browser, to an event handler method defined in the corresponding view controller.
A navigation event is raised when anoutbound plug is fired.
An inbound plug is a navigation event handler that can be registered to a navigation request.
Layout is used to create the interface between the user and the client.

WINDOW CONTROLLER ARCHITECTURE


Window controllers act as controllers without a UI (view layout). You embed all the views that are to be displayed when using a Web application in the window that is referred to by it.
The Web Dynpro window embeds the views to be displayed, as well as the navigation links. Each Web Dynpro window contains outbound plugs and inbound plugs, just like views.

No comments:

Post a Comment