Calling a subcontroller

hi all,
i have a problem regarding calling a subcontroller on pushbutton event. Actually i want to display a tableview in tray through this subcontroller.
The content of tableview is coming according to my queries but the tray is not displaying.
In runtime error i find that error is <htmlb:tray> Class <htmlb:event>(cl_htmlb_content) was not found as BSP parent elemnt.
I am not able to figure out it completely as my scenario is very much similar to what has been given in ITMVC2 application.And there is not much
difference in key things.
Followings are code of view table.htm of my subcontroller table.do where i think problem lies.
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
   <htmlb:tray id="detail" title="Employee details" design="form" width="100%" isCollapsed="false">
        <htmlb:tableView id="tvX" width="100%" visibleRowCount="5" table="<%=model->emplist%>">
        </htmlb:tableView>
</htmlb:tray>
Thanks for any suggestion and help.
Amit Kumar

Hi Max,
Below i am giving my codes.
MAIN CONTROLLER
DO_INIT
method DO_INIT.
data: model type ref to za_model_first.
data: empdetails type ref to cl_bsp_controller2.
create and register model object
model ?= create_model( class_name = 'za_model_first'
                       model_id = 'mf' ).
create subcontroller, but initially inactive
empdetails ?= create_controller( controller_name = 'table.do'
                                    controller_id = 'fld' ).
controller_set_active( controller_id = 'fld'
                       active = 0 ).
empdetails->set_model( model_id = 'mf'
                          model_instance = model ).
endmethod.
DO_REQUEST
method DO_REQUEST.
data: page type ref to if_bsp_page.
data: model type ref to za_model_first.
data: subcontroller type ref to cl_bsp_controller2.
dispatch_input( ).
page = create_view( view_name = 'first.htm' ).
model ?= get_model( 'mf' ).
page->set_attribute( name = 'manager' value = model->manager ).
page->set_attribute( name = 'show_tray' value = show_tray ).
call method runtime->server->request->get_cookie
exporting name = 'logname'
importing value = logname.
CALL METHOD page->SET_ATTRIBUTE
            EXPORTING
                   NAME = 'logname'
                   VALUE = logname.
call method runtime->server->request->get_cookie
exporting name = 'post'
importing value = post.
CALL METHOD page->SET_ATTRIBUTE
            EXPORTING
                   NAME = 'post'
                   VALUE = post.
call_view( page ).
if model->manager is not initial.
  subcontroller ?= get_controller( controller_id = 'fld' ).
  controller_set_active( controller_id = 'fld'
                         active = 1 ).
  call_controller( subcontroller ).
else.
  controller_set_active( controller_id = 'fld'
                         active = 1 ).
endif.
DO_HANDLE_EVENT
method DO_HANDLE_EVENT .
DATA: table_event type ref to CL_HTMLB_EVENT,
  DATA: model type ref to za_model_first.
  DATA: event_id type string.
  data page type ref to if_bsp_page.
event_id = event.
if htmlb_event is not initial.
  event_id = htmlb_event->id.
endif.
data:fields type TIHTTPNVP,
  wa_fields like line of fields.
  CALL METHOD request->if_http_entity~get_form_fields
    CHANGING
      fields = fields.
  loop at fields into wa_fields where name = 'manager'.
    manager = wa_fields-value.
  endloop.
case event_id.
when 'go'.
               model ?= get_model( 'mf' ).
               if model is not initial.
                  show_tray = 'X'.
                  model->manager = manager.
               endif.
when 'cpwd'.
         navigation->goto_page( 'cpwd.do' ).
endcase.
sub controller:
Only DO_REQUEST
method DO_REQUEST.
data: model type ref to za_model_first.
data: view type ref to if_bsp_page.
model ?= get_model( 'mf' ).
if model is not initial.
model->init( ).
  view = create_view( view_name = 'table.htm' ).
  view->set_attribute( name = 'model' value = model ).
  call_view( view ).
endif.
endmethod.

Similar Messages

  • Have a problem in calling a subcontroller

    I try to use the model class and call a subcontroller class to display data in another view by using the following code.
    <b>In the do_init</b>
        Create the model of this class
          l_model = create_model( model_id = c_model_id
                                  class_name = lc_class_name ).
        Create sub controller
          l_controller ?= create_controller(
                                        controller_name = lc_control_name
                                        controller_id   = c_subcontrol_id ).
          controller_set_active( controller_id = c_subcontrol_id
                                 active = 0 ).
          l_controller->set_model( model_id       = c_model_id
                                   model_instance = l_model ).
    <b>In the do_request</b>
        controller_set_active( controller_id = c_subcontrol_id
                               active = 1 ).
        call_controller( l_subcontrol ).
        clear current_event.
    At the view of subcontroller, after any event occurs, the parent controller is triggered again. Why? How can I solve this problem?

    I do appreciate your immediate reponse. However, there may be some misunderstanding. Of cource, I put the checking coming event in the do_handel_event. The details of my application is shown below.
    <b>In the do_init method</b>, all source code is the same that I posted. It has creating a model class and then a subcontroller class.
    <b>In the do_request method</b>, I have a code like this.
      <b>dispatch_input( ).</b>
      main_view =
            create_view( view_name = 'main.htm' ).
      l_model ?= get_model( c_model_id ).
    <i>To separate tasks between calling a view and calling a subcontroller, I have to have a flag, <b>current_event</b>, to check whether the coming event is search. This flag is set at the method <b>'do_handle_event'</b></i>
    if  current_event eq lc_search.
        l_subcontrol  ?=  get_controller( controller_id = c_subcontrol_id ).
        controller_set_active( controller_id = c_subcontrol_id
                               active = 1 ).
        call_controller( l_subcontrol ).
        clear current_event.
      elseif current_event is initial.
        call_view( main_view ).
      endif.
    In the do_request of my subcontroller class, I call the view of the subroutine.
    dispatch_input( ).
      l_model ?= get_model( 'mm' ).
      stock_view  =  create_view( view_name = 'stock.htm' ).
      stock_view->set_attribute(
                         name = 't_display' value = l_model->t_display ).
      stock_view->set_attribute( name = 'ITERATOR' value = me ).
      stock_view->set_attribute( name = 'show_popup' value = show_popup ).
      call_view( stock_view ).
    After any event occurs in this view of subroutine, I catch this event at the method do_handle_evnt.
    if htmlb_event is bound.
        case htmlb_event->server_event.
          when  'onSelect'.
            CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
            tv  ?=  cl_htmlb_manager=>get_data(
                                          request  =  request
                                          name     =  'tableView'
                                          id       =  'stock_tv_display' ).
            if tv is not initial.
              table_event  =  tv->data.
              row_index    =  table_event->row_index.
              if row_index is not initial.
                show_popup  =  abap_true.
              endif.
            endif.
          when  others.
        endcase.
      endif.
    After the program run through this method, it goes back to the do_request of the parent controller, main.do. This is my problem. <b>I don't want to call the parent controller again. And, my application has already been stateful.</b> Is there any way to prevent it. I sincerely appologize if I couldn't catch what you said. But, please give me some suggestions to solve this problem.
    Message was edited by: Amateur willbeProfessional
    Message was edited by: Amateur willbeProfessional

  • A problem in calling a subcontroller

    I try to use the model class and call a subcontroller class to display data in another view by using the following code.
    <b>In the do_init of main controller</b>
    * Create the model of this class
    l_model = create_model( model_id = c_model_id
    class_name = lc_class_name ).
    * Create sub controller
    l_controller ?= create_controller(
                          controller_name = lc_control_name
                          controller_id   = c_subcontrol_id ).
    controller_set_active( controller_id = c_subcontrol_id
                           active        = 0 ).
    l_controller->set_model( model_id       = c_model_id
                             model_instance = l_model ).
    <b>In the dispatch_input( ) of main subcontroller</b>
    main_view = create_view( view_name = 'main.htm' ).
    l_model ?= get_model( c_model_id ).
    <i>*To separate tasks between calling a view and calling *a subcontroller, I have to have a flag, current_event, *to check whether the coming event is search. This flag *is set at the method 'do_handle_event'</i>
    if current_event eq lc_search.
       l_subcontrol ?= get_controller(
                          controller_id =   c_subcontrol_id ).
       controller_set_active( controller_id = c_subcontrol_id
                              active        = 1 ).
       call_controller( l_subcontrol ).
       clear current_event.
    elseif current_event is initial.
       call_view( main_view ).
    endif.
    In <b>the do_request of my subcontroller class</b>, I call the view of the subroutine.
    <b>dispatch_input( ).</b>
    l_model ?= get_model( 'mm' ).
    stock_view = create_view( view_name = 'stock.htm' ).
    stock_view->set_attribute(
              name = 't_display' value = l_model->t_display ).
    stock_view->set_attribute( name = 'ITERATOR' value = me ).
    stock_view->set_attribute( name  = 'show_popup'
                               value = show_popup ).
    call_view( stock_view ).
    After any event occurs in this view of subroutine, I catch this event at <b>the method do_handle_evnt</b>.
    if htmlb_event is bound.
       case htmlb_event->server_event.
         when 'onSelect'.
           CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
           tv ?= cl_htmlb_manager=>get_data(
                                   request = request
                                   name = 'tableView'
                                   id = 'stock_tv_display' ).
           if tv is not initial.
              table_event = tv->data.
              row_index = table_event->row_index.
              if row_index is not initial.
                 show_popup = abap_true.
              endif.
           endif.
         when others.
       endcase.
    endif.
    After the program run through this method, it goes back to the do_request of the parent controller, main.do without passing the do_request of subcontroller. This is my problem. <b>I don't want to call the parent controller again. And, my application has already been stateful.</b> Is there any way to prevent it? Please give me some suggestions to solve this problem.

    Hello,
    before we go any further into your problem, here is an important thing to know:
    The method DISPATCH_INPUT is not to be overwritten - it's purpose is to just get called within DO_REQUEST of your main controller, such as to have all input values passed on to the subcontrollers.
    It also says so in the method implementation of DISPATCH_INPUT in CL_BSP_CONTROLLER2:
    <b>* ...
    This method should normally not be overwritten, besides the handling must be changed
    ...</b>
    Also, as I saw you posting somewhere else that you are another user/person - please do not use multiple accounts. You can always ask the SDN staff to solve problems with your accounts (if you can't use your first anymore), but creating a new one is not the way it should be.

  • Calling another BSP from a BSP using bsp:call having a Problem.

    Hi All,
    I have a BSP (page1.bsp), within Page1.bsp I am calling another BSP (Page2.bsp)
    But I need to Call Page2.bsp from Page1.bsp 'N' number of times depending upon an internal table, code is mentioned below ( Problem is mentioned after the code ) :
    LOOP AT mr_plan_comparison->mt_selected_plans ASSIGNING <fs_selected_plan>.
         CLEAR lr_plan.
         lr_plan = zcl_zpr_s_model_pool=>load_new_plan( iv_plan_id = <fs_selected_plan>-plan_id ).
         lr_plan->mr_phases = lr_plan->get_phases( ).
         lt_phases_of_a_plan = mr_plan_comparison->mt_selected_phases.
         DELETE lt_phases_of_a_plan WHERE plan_id <> <fs_selected_plan>-plan_id.
         lr_plan->mr_phases->mt_phases = lt_phases_of_a_plan.
         lv_comp_id_str = zcl_zxa_str=>conc( iv_1 = sy-tabix
                                             iv_2 = 'xyz' ).
         CONDENSE lv_comp_id_str NO-GAPS.
      %>
      <tr>
      <td>
    <htmlb:textView text="<b><%= zcl_zrm_s_data_manager=>get_name_from_id( iv_table_name = 'ZPR_PROGRAM'
                                                                         iv_field_name = 'PRG_ID'
                                                                         iv_field_value_id = <fs_selected_plan>-prg_id  ).%></b>" />
         <bsp:call   url     = "<%= zcl_zrm_co=>sc_bsp_rpphachart %>"
                     comp_id = "<%= lv_comp_id_str %>" >
    <%-- same subcontroller n times: use different component IDs --%>
        <bsp:parameter name  = "mr_plan"                  value = "<%= lr_plan %>" />
        <bsp:parameter name  = "mr_plan->MR_PHASES"       value = "<%= lr_plan->mr_phases %>" />
        <bsp:parameter name  = "mv_show_current_version"  value = "<%= abap_true %>" />
        <bsp:parameter name  = "mv_show_version_nr"       value = "<%= SPACE %>" />
    </bsp:call>
    I am able to display the Page1.bsp with no problem having Page2.bsp as well on it,
    But I have a radio button or a dropdown on Page2.bsp and when the event triggers it goes to the DO_HANDLE_EVENT of Page2.bsp whcih is correct but after DO_HANDLE_EVENT it does not go to DO_REQUEST of Page2.bsp and rather goes to Page1.bsp at the LOOP, by this what ever selection I did I am loosing those values.
    What changes should I make so that after Do_HANDLE_EVENT of Page2.bsp it should call it's Do_Request?
    I guess it might be related to the reference or something?
    Regards,
    Abhinav

    Hi Abhinav,
    the flow of nested controllers is as follows:
    contr1->do_request (here dispatch_input triggers data and event handling)
      -->contr1->do_handle_data
      -->contr2_1->do_handle_data
      -->contr2_2->do_handle_data
      -->contr2_3->do_handle_data
    ..... for all controllers in the hierarchy
      -->contrXXX->do_handle_event (the controller instance where the event was triggered)
    contr1->do_request continued
    call view for contr1
      -->contr2_1->do_request
      -->contr2_2->do_request
      -->contr2_3->do_request
    .... for all subcontrollers called by your logic
    the dispatch_input in the subcontroller does not have any effect as within the method it is checked whether the controller is a root controller or not.
    In case you call the subcontroller with the same component ID's than you called them before, the same instances are reused. So if you reuse the instances and set an attribute within the instance that handled the event you should be able to "remember" the values.
    Another option is to write the event back either to the application class or to the parent controller (is available via attribute m_parent) and hand it back over to the controller during the calling loop.
    Hope that helps.
    Best Regards
    Michael

  • bsp:call

    Hi!
    Hope someone can help.
    I have two MVC controllers. One main- and one subcontroller. The subcontroller is not in the same bsp application as the main controller.
    At the moment i call the subcontroller from init method with
      obj_mate_navigation ?= create_controller( application_name = 'Y0_TEST_APP1'
                                               controller_name = 'app1.do'
                                               controller_id = 'AP1'
    But i will call the subcontroller from main view. Now my problem is, that the <bsp:call> tag has no application parameter.
    Is it possible to call subcontroller from other bsp applications directly from the main view??
    Regards,
    Anto

    I dont think so you can call subcontroller which belongs to another application using <bsp:call> tag.
    Raja T

  • BSP date type input datepicker blanking out

    When I introduced tabstrips to my application(main controller view) and called the subcontroller as item of each tab the datepicker dropdown for the date fields shows up as a blank box .I have read through such similar posting but the suggestion (e.g change design to 2002+2003 ) have not worked .I would appreciate anyone inputs from anybody.
    Thanks,
    Manoj
    e.g
    <htmlb:inputField id        = "im_date3"
                      value     = "<%= test %>"
                            design  = "STANDARD"
                            type      = "DATE"
                             showHelp  = "True"
                             size = "10" />

    please post this in BSP forum for better response.
    Business Server Pages (BSP)
    check out OSS note no. 616900
    Regards
    Raja
    Message was edited by: Durairaj Athavan Raja

  • Questiong in using a model class

    I'm pretty new with the MVC design pattern. When using the model class, I don't know what is the more advantages of using the model class instead of using an application class.
    Moreover, in my application, there are two pages. One is used for searching screen, and the other is used for displaying a result. I try to use the model class to receive all input parameters passed by the view. Everything is fine. After users clicks a search button, a search controller will call the subcontroller which displays a result. At this point, I cannot figure out the best place where calling subcontroller should be. Right now, I put it in the do_request method; nevertheless, I have to detect the search event in this do_request method, as well. In my view, it seems strange! Are there any other solutions or examples matching my problem.

    MVC design pattern is to seperate out different logic. and at the same time keeping them as a seperate entity so that they can be used multiple times(reusability) in different controllers or so.
    yes it is posible to implement the same using application class. like we can make 1 class for mode(business logic) and one for control(class 2) and now make our application class which will inherit these two. this way it will work fine. but in this  yet we are seperating the business and control logic but we are not able to make the act as a seperate entity. the objects  of their type will be live via application class throughout the application.
    and if we make them as a different class instead of inheriting them in application class, and instatiate them whenever require, then that is MVC, that is what we are doing. we are just bypassing application class since we can directly use  class of controller type(super class CL_BSP_CONTROLLER).
    there is no such heirarchy type layering in MVC, these are like three different objects and we are making them communicate to each other so that functionality of each can be seperate out.
    hope this clears your doubt.
    there is a application like you are looking for:
    check it:
    http://help.sap.com/saphelp_erp2004/helpdata/en/12/1eeeb4245d1f4f96c989519261b0f6/frameset.htm
    it is in sap as : bsp application : TUTORIAL_4_MVC  
    it has a controller for searhing search.do
    hope this helps,
    regards,
    Hemendra

  • Call_controller & goto_page

    I guess these are basically the two ways to ´navigate´ around my application..
    1)we can use call_controller() to call a subcontroller and show it inside the current view. or we would show only the subcontroller view if the parent controller doesn´t have a page(view) of its own.
    2)in case we just want to call another page, giving it full controll, that is our current controller will die as soon as the new one is invoked. in this case we can use goto_page(). I´m missing only one thing here.. how to pass parameters.. a string for example.. Can we use navigation->get/set_parameter()?
    I also found the useful application object. We have a reference to this instance from every controller..! Even from a controller that we called using goto_page().
    I´m planning to use this ´application´ object to share objects references between different controllers. This is my idea: finding a way to pass parameters to a controller that I called using goto_page() then using that parameter to the the reference of an object instance that I´m keeping in the application class (just the way controllers keep a list of model objects using a string as key to get their reference)
    I would greatly appreciate any comments on this..

    Craig,
    This is great, now we have TWO very good choices to  handle navigation and therefore structure our applications.
    Our goal now should be to find the pros and cons of each. I whish someone with this kind of experience would read this post and share his/her experience!!
    a)we can have a controller with different views (I´d use this for controllers that switch between view/edit mode).
    b)calling subcontrollers is obviously necessary to build pages 'composed' by several controllers/views. For example a search tray and a result-display tray. Or a list-elements tray and a display-selected-element tray.
    c)The most powerfull reason that I found to use goto_page is that in a big application you just can´t have a main controller handling all the rest. I mean I just wouldn´t know how to do it..? When and from where to create/call/destroy subcontrollers..? (does anyone have an answer for this?)
    Anyway.. the use of goto_page allows you to have a low coupling.. (at least that´s the way I see it..)
    Using this alternative you can structure your application in ´modules´ and make a goto_page to swith from clients to projects just to give an example..
    d)One last question that I have. what should be kept in the application class, how should it be kept and for how long? who is responsible to destroy objects that are no longer used? Remember that we could have a controller create a model, register that model in the application class, then call another controller with goto_page, passing the model´s name as parameter. this other controller would look up the model by its name (that we passed as url parameter) and use it. We could also have global data.
    any comments are welcomed!!!

  • Nested subcontrollers problem

    Hi,
    I have an application with one main controller and some nested subcontrollers.
    On the main page I have <bsp:call> to subcontroler 1, and on the page controlled by subcontroller 1 I have another <bsp:call> to subcontroller 2.
    The problem is that when I trigger an event on the page controlled by subcontroller 2 the request is not catched by the do_handle_event of subcontroller 2.
    I have dispatch_input() in do_request of main controller and nowhere else.
    My application is stateful.
    Does anyone know how to build application with nested controllers

    You <b>need not</b> to have dispatch_input() in all the subcontroller..
    In Main Controllers DO_INIT() method: You need to attach the subcontroller:
    sub_cont1 ?=
      create_controller( controller_name = 'list.do'
                         controller_id   = 'List' ). 
    sub_cont2 ?=
      create_controller( controller_name = 'control.do'
                         controller_id   = 'Detail_Long_Id' ).
    Look at the SAP standard BSP Application <b>BSP_MODEL</b>. You will get the clear idea..
    Raja T

  • Call subcontroller in new window

    at the moment, i show a subcontroller in the middle of my page like this
    <bsp:call url  = "myController.do" comp_id = "abc">
      <bsp:parameter name="mr_object"
                     value="<%= controller->mr_object %>" />
    </bsp:call>
    Now I would like to open the subcontroller page in a new window. I usually did this with
    window.open("myController.do?parameter1=value1");
    But now I am not sure how to pass parameters to the newly opened page. I know it works with simple parameters, but I assume that it won't work with references. Is that right? Is there another way?

    Hi Daniel,
    yeah you are right it does not work with references. I would do the following. Store the object the subcontroller has to access in the application class and pass the name of the attribute and the attribute which should get the reference as a parameter.
    window.open("myController.do?name=controllerAttribute&value=applicationClassAttribute");
    This makes is possible for the subcontroller to access the objects in the application class dynamically.
    regards
    Thomas

  • Creating subcontroller in application class function

    i am using a certain subcontroller quite frequenly in my BSP-app. I wrote this function to craete the subcontroller:
    method create_sc.
      data lorv_subcontroller type ref to zcl_bla.
      lorv_subcontroller ?= create_controller( controller_name = 'bla.do'                     controller_id   = iv_controller_id ).
      lorv_subcontroller->init( ... ).
    endmethod.
    at the moment, this function is in another (super-)controller-class. since i need the subcontroller on multiple pages, i wanted to move the function to my application class or to a static class. however, this doesn't work, probably because i can only call create_controller() from within a controller-class.
    what can I do? isn't it possible to make this function available to other controller-classes?
    could i maybe pass a reference to a subcontroller-variable (here lorv_subcontroller ) to the method?

    Is there a concept of multiple inheritance (I don't think so!!!) ?
    Let me just paraphrase, what you have said :
    ycl_maincontroller inherits cl_bsp_controller2
    and all other controllers inherit ycl_maincontroller.
    But if you make ycl_maincontroller abstract, you can't implement the method create_sc, right!!!
    But your idea is a very novel one. THanks for sharing it with us.
    Regards,
    Subramanian V.

  • How to use "document.getElementById()" using MVC and  bsp:call

    I follow the tutorial from saptechnical .com about F4 in BSP and it works.
    But my problem, is that is not working in my BSP I get javascript error "document.getElementById() is null" the popup appear I select the value but when I press the button to close the popup and pass the value nothing appears.
    I think that is because im Using MVC and Views that call a controller (like view inside views).
    I have in my main.htm this:
    <htmlb:form id     = "search"
                   method = "get" >
            <bsp:call url     = "search.do"
                      comp_id = "search" >
            </bsp:call>
    </htmlb:form>
    The code with the help values is in the search.htm(this the page associated with controller search.do)
    So Im thinking that my problem is because the form isnt in the SAME page than my inputField  and that is why im getting that error.  Can be this true ?
    And if it is,  how can I solve it?, I have several pieces of page with controllers and If I try to put the form tag in each "piece" I get an error that a button was left without a parent form tag, and I there isnt any button tag without form tag. So I think that another element tray, tabstrip or something require form tag also.
    I hope that I could explain my problem and someone can give me a hand.
    Can It be that this js statement
    document.getElementById("i_VKORG_low").value = fval;
    only works only if the form tag is in the same htm page, and cause I have teh form tag declared in the main.htm and the fieldtext i_VKORH_low in search.htm it doesnt works ?
    Thx
    EDIT: I cant post my javascript source code...dont know why I get an error from the forum that the post is not supported

    Hello,
    If I remember well, the MVC framework adds the comp_id of the bsp_call to all elements in the subcontroller.
    Try using:
    document.getElementById("search_i_VKORG_low");
    Regards,
    Tanguy

  • OnValueHelp call Javascript Function

    Hi,
    I have created an inputfield with a f4-button.
    If the button is clicked a javascript function shall be called.
    The function has an input parameter.
    I tried thid but it doesn't work. I think that the error is located in the last line when
    I try to call the function.:
          <htmlb:inputField id            = "descr_<%= lv_counter %>"
                            value         = "<%= ls_comp-task_descr %>"
                            maxlength     = "40"
                            submitOnEnter = "FALSE"
                            showHelp      = "X"
                            onValueHelp   = "call_f4_help('descr_' + <%= lv_counter %>);"  />
    can you help me?
    Best regards
    Alberto

    Hi Alberto,
    I guess that there is some issue with the ID not fitting. Therefor I'd suggest the following:
    Define 2 variables on top of your view/page:
    data: lv_id type string,
            lv_script type string.
    Insert directly before your inputfield the following:
    <% lv_id = lv_counter.
          condense lv_id no-gaps.
          concatenate 'descr' lv_id into lv_id.
          concatenate 'call_f4_help("' lv_id '");' into lv_script. %>
    And change the inputfield to:
    <htmlb:inputField id = "<%=lv_id%>"
    value = "<%= ls_comp-task_descr %>"
    maxlength = "40"
    submitOnEnter = "FALSE"
    showHelp = "X"
    onValueHelp = "<%=lv_script%>" />
    There are 2 things you need to be aware of:
    1. In case you use Controller + view do not use underscores in the ID's. Underscores are used to ensure unique ID's in case you use subcontroller.
    2. In case you use that on a subcontroller you need in addition to the upper coding:
      Change the controller class of the view to CL_BSP_CONTROLLER2.
      Change the coding before the inputfield to
    <% lv_id = lv_counter.
          condense lv_id no-gaps.
          concatenate 'descr' lv_id into lv_id.
          "add the call to get the correct ID from the controller for the script
          "the inputfield does this call automatically during rendering
          lv_script = controller->get_id( lv_id ).
          concatenate 'call_f4_help("' lv_script '");' into lv_script. %>
    Hope that helps.
    Best Regards
    Michael

  • bsp:call doubt

    Hello All,
    When we call the sub controllers using the bsp element call of the bsp extension i.e. say for example
    <bsp:call url = "contorller01.do" comp_id = "subc1" />
    from the main view which is called by the top controller, this must be listed in the parameter m_subcontrollers of the top controller; right ?
    Or is it a must that we should redefine the DO_INIT of the top controller, and add the following lines
      DATA: subc1 TYPE REF TO z_c_10017_test08_cntrl1.
      subc1 ?= create_controller( controller_name = 'controller01.do'
    controller_id   = 'subc1' ).
    in aditions to the above.
    In the SAP example itmvc2, the DO_INIT method of the controller CL_BSP_ITMVC2_MAIN is not redefined. But the parameter m_subcontrollers of the controller CL_BSP_ITMVC2_MAIN list the sub controllers with ids "ad" and "fl" which was called using <bsp:call> from the main view.
    I tried a similar one, but the parameter m_subcontrollers of the top controller does not list the subcontrollers I call using <bsp:call> in the main view, unless and until I redefine the  DO_INIT of the top controller and use the service method create_controller in addition to <bsp:call>.
    I hope the question is clear.
    Could any one give me some idea on this.
    Best Regards,
    Loveline.

    Hi Sebastian,
    This is also what I expected, but this is not happening in my test BSP Application. I have included the code below
    Layout of main.htm
    <htmlb:content>
      <htmlb:page title="Main view " >
        <htmlb:form id     = "myform"
                    method = "post" >
          <htmlb:tray id     = "T1"
                      title  = "View1"
                      design = "form" >
            <bsp:call url     = "controller01.do"
                      comp_id = "subc1" />
          </htmlb:tray>
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    DO_REQUEST of main.do
    method DO_REQUEST .
      DATA : view TYPE REF TO if_bsp_page.
      dispatch_input( ).
      view = create_view( view_name = 'main.htm' ).
      call_view( view ).
    endmethod.
    Layout of view1.htm
    <table>
    <tr>
    <td>
    <htmlb:label id   = "L1"
                 for  = "IF1"
                 text = "Input Field" />
    </td>
    <td>
    <htmlb:inputField id   = "IF1"
                      size = "10" />
    </td>
    </tr>
    <tr>
    <td>
    <htmlb:button id      = "B1"
                  text    = "Click"
                  onClick = "myClickHandler" />
    </td>
    </tr>
    </table>
    DO_REQUEST of controller01.do
    method DO_REQUEST .
      DATA : view TYPE REF TO if_bsp_page.
      view = create_view( view_name = 'view1.htm' ).
      call_view( view ).
    endmethod.
    m_subcontrollers parameter of main.do (top controller) doesn't contain the subcontroller with id subc1.
    Is there anything that I am missing ? and are you sure <bsp:call> will register the subcontroller with the top level controller ?
    Thanks and Regards,
    Loveline.

  • Getting tableview selectedrowindex from subcontroller

    Hi experts,
    I have a tableview created by one of my sub views.
    Please see the following image link for my design:
    http://img203.imageshack.us/img203/2298/subcontrollers6ub.gif
    The view with the red border is the one displaying the iterator/tableview.
    I need to get the selected row index in my main controller (<b>MAIN.DO</b>)
    In my main controller's DO_HANDLE_EVENT, the following code works only IF the iterator resides in "Page1.htm".
    The iterator is now located in Page1_Sub2.htm.
       WHEN 'getChange_exprep'.
          tbv ?= CL_HTMLB_MANAGER=>GET_DATA( request = request
                                             name    = 'tableView'
                                             id      = 'tbv_ExpRep' ).
          IF tbv IS NOT INITIAL.
            tbv_event = tbv->data.
            selectedRowIndex = tbv_event->SELECTEDROWINDEX.
            IF selectedRowIndex <> 0.
              DELETE model->AT_IUI_COSTASSIGNTRIP INDEX selectedRowIndex.
            ENDIF.
          ENDIF.
    I can get a reference to my subcontroller from my main controller, but i don't know how that can help.
    Any idea?
    Message was edited by: Kevin Wong

    Hi Kevin!
    Dispatch_input( ) needs the appended sub-controller-ids to determine the controller which is responsible for handling the events. Hence, at least the do_handle_event( ) of your sub-controller should be called! Try to debug the method (set a breakpoint directly at the beginning of the method). If the sub-do_handle_event( ) is not called, then try to look if the sub-controller is correctly assigned to your main-controller (check attribute 'm_subcontrollers' in debugger)! This shouldn't be the problem because you assigned a component id to the sub-controller in your <bsp:call>-tag ..
    If do_handle_event( ) is called correctly, than you should change the id of the table in the coding you posted in your first message:
    tbv ?= CL_HTMLB_MANAGER=>GET_DATA(
      request = request
      name    = 'tableView'
      id      = 'subcontrollerid_tbv_ExpRep' ).
    Then the attribute selectedrowindex should be available in tbv.
    Best regards,
    Georg
    Message was edited by: Georg Lang

Maybe you are looking for

  • Whenever I right click on any link the link gets opened in new tab

    Whenever I right click on any link, along with context menu pop up (Correct property) the said link also gets opened in new tab (next to running tab in background : wrong property) Initially I thought it is due to one of the add-on installed on searc

  • Hot to gain space back in a tablespace after purging

    Hi, We are Oracle Apps shop running 11.5.0.2 and DB on 11.2.02 Some of our tablespaces are about 90% full. I can always add dataifles to it, but before that, I purged a lot of old WF data (almost 3 M rows). But my tablespace is still showing me 90 %.

  • Admin server segfaults

    I get this error message when installing under Redhat 7.3: [snip] Configuration of the Administration Server succeeded. SunONE-WebServer-Enterprise/6.0SP3 B05/14/2003 18:35 failure: server terminated (signal 11) (Interrupted system call) failure: ser

  • HT3275 start time machine backup immediately

    How to start a time machine backup immediately ?

  • Tiger to Leopard... Need to re-install Windows Partition?

    Hi everyone, I'm running Tiger right now and I am going to buy Leopard soon. Judging from all the problems people are having. I have decided I am going to do an Erase and Install. However, I'm running Boot Camp under Tiger right now. If I do an Erase