Hook Methods: Methods Called by the RuntimeLocate this document in the navigation structure

Use

In addition to the application methods, each local controller interface has a fixed number of methods that can only be called by the runtime. The application developer cannot specify when these methods are called, but can modify the implementation. The time when these methods are called is predefined. For a description, refer to the phase model of Web Dynpro.

WDDOINIT and WDDOEXIT

The simplest examples are the methods WDDOINIT and WDDOEXIT.

WDDOINIT is called automatically when a controller is initialized for the first time. For each newly created controller, this method is empty but can be filled with suitable source code. These methods can contain the following steps, for example:

  • Creating instances of help classes

  • Initializing controller attributes

    If you need more attributes for the programming and these are also reference variables, they can be initialized here.

  • Triggering authorization checks (to be done in help classes)

  • Setting initial values of the controller context

  • Instantiating used components

    See Cross-Component Programming .

Example of the initialization of a controller context:

method WDDOINIT . 
data: NODE type ref to IF_WD_CONTEXT_NODE,
      FLIGHTS type SPFLI_TAB.
* get node from context 
  NODE = WD_CONTEXT->GET_CHILD_NODE( 'CARRIER_NODE' ).
* get connections from helper class
  FLIGHTS = CL_WD_GET_SPFLI=>GET_FLIGHTS( ).
  NODE->BIND_ELEMENTS( FLIGHTS ).
endmethod.
            

WDDOEXIT is called by the runtime when the controller is exited and can be used for releasing locks, for example.

Depending on the value of the controller the local controller interface also has the following hook methods available:

Component Controller

View Controller

Window Controller

WDDOINIT / WDDOEXIT

WDDOINIT / WDDOEXIT

WDDOINIT / WDDOEXIT

WDDOAPPLICATIONSTATECHANGE

WDDOBEFOREACTION

WDDOBEFORENAVIGATION

WDDOAFTERACTION

WDDOONOPEN

WDDOPOSTPROCESSING

WDDOMODIFYVIEW

WDDOONCLOSE

 

WDDOONCONTEXTMENU