on 04-24-2008 11:36 AM
Hello,
in Do_Init of the main controller I´m creating the subcontrollers
sub_edit ?= create_controller( controller_name = 'edit.do'
controller_id = 'editctrl' ).
subc_user ?= create_controller( controller_name = 'overview/user.do'
controller_id = 'userctrl' ).
in Do_Request of Edit.do I call the layout Edit.htm and in this one I call the subcontroller userctrl
<%-- Code Personal Nr. --%>
<bsp:call comp_id = "userctrl"></bsp:call>
the damned layout never shows up in the application and I don´t know why. This other option does not work:
<bsp:call comp_id = "editctrl_userctrl" />
Can somebody tell me what the problem is ??
Thanks a lot.
Hi,
You said:
in Do_Request of Edit.do I call the layout Edit.htm and in this one I call the subcontroller userctrl.
userctrl should then be a subcontroller of edit.do instead of your main controller.
Regards,
Tanguy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello guys,
Ramu:
your method doesn´t work, because the controller cannot be found
Tanguy:
your idea is not bad but it didn´t work with me and now I face the problem that I don´t see the content of layout User.htm in Main.htm
The subcontroller is called from 2 places (for avoiding repetion of code): Main.htm and Edit.htm and both like this:
<bsp:call comp_id = "userctrl" />
that´s why I created the subcontroller in Main.do
Hi,
Does it have to be the same controller instance for both main and edit controllers? I think you should create two controller instances, one for main and another for edit.
If you need the same instance, you can create it in main.do, then register it as a subcontroller of edit.do with if_bsp_dispatcher~register method. Still, this sounds weird to me since you will call twice the same controller within the same htmlb:form tag, which can create field ID conflicts. You will have to be careful if you use this.
Code example, in main controller:
edit_ctrl ?= create_controller( controller_name = 'edit.do' controller_id = 'edit' ).
user_ctrl ?= create_controller( controller_name = 'user.do' controller_id = 'user' ).
edit_ctrl->if_bsp_dispatcher~register( comp_id = 'edit_user' comp_instance = user_ctrl ).
In main.htm:
<bsp:call comp_id = "edit"></bsp:call>
<bsp:call comp_id = "user"></bsp:call>
In edit.htm:
<bsp:call comp_id = "user"></bsp:call>
Hope it helps,
Tanguy
Hi,
I think you have to specify the URL attribute of bsp:call tag:
<bsp:call comp_id = "userctrl" url = "overview/user.do" />
Regards,
Tanguy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I´ve tried that option before and doesn´t work. If we specify the URL, that means that we´re calling the controller for the first time and therefore it is created. In Do_Init I collect the model class from father object and with the URL, there´s no father and therefore a get a short dump.
I call the same controller from Main.htm just the same way and it works !!
Thanks anyway.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.