Skip to Content
author's profile photo Former Member
Former Member

Controllers and Subcontrollers - how to set hierarchy?

This may be a stupid question, but... how do you set up a hierarchy of controllers and subcontrollers? I know that the top controller has a blank COMPONENT_ID (according to the code), but where do we specify this when creating a controller? And a subcontroller can have subcontrollers of its own (I think) - what would indicate the top controller in that situation?

Where is all this set? By the time my debugging session kicks in (DO_REQUEST of top controller) the table M_SUBCONTROLLERS has already been set up. I have followed the logic back to the adapter object, and the page object, then I start to get stuck, partly because I don't know what these objects are really for.

It would be nice to know what mysterious entity controls the controller class - calling the methods of that class such as DO_INIT, DO_REQUEST for example.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Oct 23, 2003 at 05:27 PM

    Hi Paul,

    The hierarchy is set automatically. If you create a controller (either with method "CREATE_CONTROLLER" or implicitely via <bsp:call > in the view belonging to your current controller, the new controller alway become a child of the current controller.

    If your BSP application is stateful and you pass an id on creating the new controller, this created controller will live until the parent controller is destroyed, or until you delete the subcontroller explicitely.

    Otherwise the sub-controller lives only for this request.

    There are some methods that you should know:

    1. DO_INIT is a kind of "constructor", which means that it is called on creation of a controller

    2. DO_REQUEST is called for each request either via "CALL_CONTROLLER" of via <bsp:call >.

    3. The input handling must be triggered with the call of "DISPATCH_INPUT()", which must be done in the DO_REQUEST-method of the main controller. This calls the methods DO_HANDLE_DATA of each active controller, DO_HANDLE_EVENT of the controller responsible for the control that triggered the event, and DO_FINISH_INPUT of all active controllers. These methods should handle the complete input.

    Regards, Regina

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.