Class CL_BSP_CONTROLLER2 - Methods
§Methods where overwriting is possible
Method
|
Description
|
DO_INIT
|
This method is called once at the start and is used for initialization. This method behaves like a constructor method.
|
DO_INITATTRIBUTES
|
This method is called with every request and is used to initialize the attributes. The parameters are read from the request. In this method, you can also execute initializations that are required for each request. You can also use this method to set additional attributes. This method is not absolutely necessary, since you can use DO_REQUEST to solve everything that you can (theoretically) handle here.
|
Class CL_BSP_CONTROLLER2 - Methods
Service functions
Method
|
Description
|
CREATE_VIEW
|
Creates or fetches a view instance
|
CALL_VIEW
|
Calls the request handler of the view instance
|
CREATE_CONTROLLER
|
Creates or fetches a controller instance
|
CALL_CONTROLLER
|
Calls the request handler of the controller instance.
|
SET_MODEL
|
Creates and registers a model instance
|
CREATE_MODEL
|
Creates and registers a model instance
|
GET_CONTROLLER
|
Fetches a sub-controller
|
FILL_MODEL_DATA
|
Fills the model data
|
GET_MODEL
|
Fetches a model instance
|
§The methods of class CL_BSP_CONTROLLER2 are used to create Components as part of the Model View Controller design pattern.
§Process
§First call DO_INIT , DO_INITATTRIBUTES and then DO_REQUEST.
§With a main controller, DO_REQUEST takes care of both input and output processing.
§Handling events
§DISPATCH_INPUT then calls method DO_HANDLE_DATA. DO_HANDLE_DATA fills the model class.
§Once DO_HANDLE_DATA has filled all data, method DO_HANDLE_EVENT is called for the controller that is responsible for the input event. This also states the event ID and the event is dispatched to the controller. DO_HANDLE_EVENT also outputs parameter GLOBAL_EVENT (a string).
Page Input (DO_HANDLE_DATA)
Page Input (DO_HANDLE_EVENT)
Page Input (DO_FINISH_INPUT)
§Method DO_FINISH_INPUT is always called (for every controller, that is, for all active components). You can use it to react to events in a component that occur in a different component. To do this, use parameter GLOBAL_EVENT, which is set in method DO_HANDLE_EVENT. Using this global event, at the end of input processing each component should know exactly which events are present and how to react to them.
No comments:
Post a Comment