on 04-29-2004 9:49 PM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.