Entering content frame

Background documentation Programming Controller Methods Locate the document in its SAP Library structure

In general, attributes and methods are used to specify the processes of programs in Web Dynpro applications and to edit the data contained in the context. The former chapters Action Event Handlers and Cross-Controller Method Call described simple examples of these program processes. In this chapter, you find general information on programming using methods of the Web Dynpro framework. In addition, frequently used methods are described and illustrated by source code examples.

For further information on specific controller methods, refer to document Controller: Methods in the tools manual and chapter Controller Classes and Controller Interfaces in the reference section of this documentation.

When you create a new Web Dynpro component, a component controller is automatically created for this component. When you create a view for a Web Dynpro component, a view controller is automatically created for this view. Each window of a component contains a window controller and you can create custom controllers for specific purposes.

 

At least two attributes are automatically known to each controller, namely the following object references:

     WD_CONTEXT

     WD_THIS.

 

You can also create your own attributes for each controller. These attributes are used to store non-UI-relevant application data (UI-relevant data is stored in the context).

 

Constants for Context Nodes

For every node you create in the context of a controller, a constant with the name WDCTX_<node name> is automatically created in the corresponding interface IG_<Controller_Name> and IF_<Controller_Name>. In the source code of the controller, this constant can then be used for the node name instead of a string literal. Example:

 

 

wd_context->get_child_node( wd_this->wdctx_my_node ).

instead of

 

wd_context->get_child_node( 'MY_NODE' ).

 

The advantage of using constants is that the compiler knows the constant and, therefore, syntax errors are triggered if the name of the context node contains typing errors. However, it is also possible to pass a string literal.

 

Interface Controller

The additional interface controller listed in the development environment is not an independent object but a specific subset of the component controller:

The interface controller defines the interface of a Web Dynpro component for the use in another component. The methods are implemented in the component controller. When you set the Interface flag for methods/events/context nodes in the component controller, these elements are copied into the interface controller.

 

 

Leaving content frame