on 01-19-2005 10:33 AM
Hi guys, hope your thinking caps are on
I have a controller which has a drop downlist box and 2 BSP call's to other controllers in the view.
When I select an item from the drop down I want the two other controllers to refresh as well.
I have the controllers declared in my DO_INIT and in my main view they are all between the FORM tags however the two other controllers only refresh at startup and not after I select from the drop down.
I know that the problem is simply that nothing is telling the controllers to refresh and if I do the controllers as "subcontroller" it works but then I loose my formatting, the two controllers are located in the middle of a gridlayout with other items in cells around them.
Thoughts, suggestions? It has to be something easy I am missing.
Hey Craig,
once again, let's start the discussion (will it turn out to become that long again ...?)
I would avoid using the term "refreshing a controller".
Refreshing is linked to the display of the page, whereas the controller is not.
My guess is that you want just the areas, where your 2 sub-controllers (more exactly, their views) reside, to load again when you make a selection in the dropdown.
To clear some uncertainty - should the whole page be loaded again on dropdown selection, or should it not (or does it not matter)? I think you want to use something like onClientSelect, but let's get sure about that before I run into the wrong direction ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Max,
Controller: manage.do / manage.htm
<%@page language="abap" %>
<%@extension name="bsp" prefix="bsp" %>
<%@extension name="htmlb" prefix="htmlb" %>
<%@extension name="phtmlb" prefix="phtmlb" %>
<%@extension name="xhtmlb" prefix="xhtmlb" %>
<htmlb:content design="design2003" >
<htmlb:page title="Solution Central" >
<htmlb:form method = "POST"
id = "frmDetail" >
<htmlb:gridLayout columnSize = "2"
rowSize = "1"
width = "100%"
cellPadding = "3"
style = "ALTERNATING" >
<htmlb:gridLayoutCell columnIndex = "1"
rowIndex = "1" >
<bsp:call comp_id="sysstatus" />
</htmlb:gridLayoutCell>
<htmlb:gridLayoutCell columnIndex = "2"
rowIndex = "1" >
<bsp:call comp_id="dbsize" />
</htmlb:gridLayoutCell>
</htmlb:gridLayout>
</htmlb:form>
</htmlb:page>
</htmlb:content>
DO_INIT
sysstatus_controller ?= create_controller( controller_name = 'objs/sysstatus.do'
controller_id = 'sysstatus' ).
dbsize_controller ?= create_controller( controller_name = 'objs/chart/dbsize.do'
controller_id = 'dbsize' ).
DO_REQUEST
* Start event handling
dispatch_input( ).
* Create view
default_view = create_view( view_name = 'manage.htm' ).
default_view->set_attribute( name = 'lv_systemtab'
value = lt_itab_sys ).
default_view->set_attribute( name = 'lv_sid'
value = lt_sid ).
* Call view
call_view( default_view ).
Controller: objs/chart/dbsize.do / dbsize.htm
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:chart id = "myChart"
data = "<%= lv_data %>"
width = "200"
height = "200"
title = "Database Size"
titleCategories = "Date"
titleValues = "Size"
displayObjectValues = "true"
chartType = "AREA_STACKED_3D"
legendPosition = "NONE"
colorOrder = "STRAIGHT" />
Controller: objs/sysstatus.do / status.htm
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:tableView id = "Status"
table = "<%= lv_status %>"
iterator = "<%= iterator %>"
footerVisible = "false" />
Yes the problem is that manage.do keeps the value of the SID and stores it to the model however when dbsize.do or sysstatus.do read the model the value is empty.
I also notice that sysstatus.do-DO_REQUEST and dbsize.do-DO_REQUEST fire and run BEFORE manage.do and therefore they would not get the correct value even if it was working.
So I must be doing something wrong in with my model and how I store the value????
So I need an example if anyone can point me in the right direction???
Are you using the same model reference in the controllers?
(... either by sub_controller->set_model() in main ctr or by parent_ctr->get_model() in sub ctr ...)
Maybe you're creating references to initial model objects instead of fetching the existing one?
As to the DO_REQUEST of your sub ctr running before manage.do ... which method of manage.do?
In my program all input processing takes place in SET_ methods of the model (called automatically through data binding).
And, as these methods are executed before DO_HANDLE_EVENT of the triggering controller is called, there you should be able to work with submitted values, DO_REQUEST gets called even later ...
Check for the model reference in the controllers, and specify where exactly you read/write the SID value of the model.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.