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

Question about BSP-MVC controller nesting

Hi Experts-

I am developing an MVC compliant BSP application.

Can I nest controllers in BSP's implementation of MVC?

Meaning, in the view that is created by my master controller I have an HTMLB tray control. That tray control uses bsp:call to call a different controller. The called controller has two HTMLB tray controls inside of it's view. These trays then further bsp:call two separate controllers also each with their own views.

Can I have a controller that in-turn calls another controller which calls two other controllers and have them all be on the screen at the same time (some within others)?

I have the following controllers (and their views):

1.do - 1.htm

2.do - 2.htm

2a.do - 2a.htm

2b.do - 2b.htm

I want 1.do to be my application's point of entry. Starting out, in the view 1.htm, I want to bsp:call 2.do. 2.htm should then further call 2a.do and 2b.do. So 1.htm and 2.htm and 2a.htm and 2b.htm should all show up on my screen at the same time (2a.htm and 2b.htm in 2.htm and 2.htm in 1.htm).

Is this possible?

Thanks,

- Vik.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Apr 29, 2004 at 11:30 PM

    Figured out the answer to this one.

    It is a resounding YES.

    Moved 'dispatch_input' to the top controller. Made sure that every ".htm" (view) file has bsp extensions reference declared up top [alongwith ABAP and HTMLB].

    I get more and more impressed the more I learn about the MVC implementation in BSP. Powerful, simple and effective.

    Better than Struts maybe? LOL.

    😊

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Vik,

      yes, nesting of components (ctrl+view) is very nice; looking at your application as a tree of controllers and subcontrollers gives an intuitive view on how the application is organized and works.

      You get an easy to use event handling mechanism 'for free' as the framework makes sure that events arising from a component are only perceived in the pertaining (sub-)controller. It also makes for good reusebility of parts of your application as quite often (I found) you can reuse (sub-)controllers in other applications without much adjustment.

      Just one additional hint: whenever you deal with IDs of bsp elements in your (controller)code, e.g. with the method <i>get_form_field(someID)</i>, make sure you construct the ID like

      CONCATENATE me->component_id '_theElementsID'

      This is because IDs from elements on subviews get automatically prefixed with all the (super-)controller's component IDs.

      Regards,

      Sebastian

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.