cancel
Showing results for 
Search instead for 
Did you mean: 

Question about BSP-MVC controller nesting

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Vik,

i have the same problem now, please tell what you did?

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

thanks in advance.

Former Member
0 Kudos

Hi

It is possible to call another subcontroller from main controller or other sub controllers. You don't have to have .bsp extension for your iviews at all.

-Suresh

maximilian_schaufler
Active Contributor
0 Kudos

Hi Nelson,

what Vik was trying to explain was the need for this line in every view that calls another controller:

<%@extension name="bsp" prefix="bsp" %>

When you say you have the same problem ... do you have a specific problem/error you run into? Or do you just want to accomplish the same result?

Cheers,

Max

sumith_rajagopalan
Participant
0 Kudos

I was facing the same proble for 2 days.. & finally I found the solution by seaching the forum.

I feels really good. Also thanks for the input that every1 has put in.

Regards,

Sumith.

Message was edited by: Sumith Rajagopalan

Former Member
0 Kudos

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