MVC: DO_HANDLE_EVENT

Ok this is a silly one and I'm just too close to it I think.
I have a View/Controller: header.htm/header.do and one View/Controller: admin.htm/admin.do
In my header I put a dropdownlist and I call header from inside my admin.do
<bsp:call url="header.do" comp_id="hd" />
But the DO_HANDLE_EVENT for header.do never activates when I select from the dropdownlist only DO_REQUEST,  dispatch_input( ) never goes into DO_HANDLE_EVENT??
What am I doing wrong?

OK I am calling ADMIN.DO via the URL
ADMIN.DO loads the VIEW "admin/default.htm" which has a BSP call
<%@page language="abap" %>
<%@extension name="bsp" prefix="bsp" %>
<%@extension name="htmlb" prefix="htmlb" %>
<%@extension name="xhtmlb" prefix="xhtmlb" %>
<htmlb:content design="design2003" >
  <htmlb:page title="Solution Central" >
    <htmlb:form method = "POST"
                id     = "frmDetail" >
      <bsp:call comp_id = "hd" />
      <htmlb:group id      = "myG"
                   design  = "sapcolor"
                   tooltip = "Input selection"
                   width   = "100%" >
        <htmlb:groupHeader>
          <htmlb:textView text   = "Administration Tasks"
                          design = "HEADER1" />
        </htmlb:groupHeader>
        <htmlb:groupBody>
        </htmlb:groupBody>
      </htmlb:group>
      <xhtmlb:protectDoubleSubmit text   = "Loading..."
                                  active = "true"
                                  title  = "Please Wait" />
    </htmlb:form>
  </htmlb:page>
</htmlb:content>
The DO_INIT of ADMIN.DO (ZCL_C_ADMIN)
  model ?= create_model( class_name = 'ZSC_CL_M_MAIN'
                           model_id = 'mf' ).
  header_controller ?= create_controller( controller_name = 'header.do'
                                          controller_id   = 'hd' ).
DO_REQUEST (ADMIN.DO)
* Object definitions
  data: iterator TYPE REF TO ZSC_TABLE_ITERATOR_SYSTEMS.
* Create objects
  CREATE OBJECT iterator TYPE ZSC_TABLE_ITERATOR_SYSTEMS.
* Create pointer to model
  model ?= get_model( 'mf' ).
* Data definitions
  data: default_view type ref to if_bsp_page.
* Start event handling
  dispatch_input( ).
* Create view
  default_view = create_view( view_name = 'admin/default.htm' ).
* Call view
  call_view( default_view ).
DO_REQUEST (HEADER.DO)
* Data definitions
  data: default_view type ref to if_bsp_page.
* Create view
  default_view = create_view( view_name = 'header.htm' ).
* Set Attributes
  default_view->set_attribute( name = 'lv_name'
                               value = m_usrname ).
  default_view->set_attribute( name = 'lv_fullname'
                               value = m_usrfullname ).
  default_view->set_attribute( name = 'lv_lang'
                               value = m_usrlang ).
  default_view->set_attribute( name = 'lv_lang_graphic'
                               value = m_usrlang_graphic ).
  default_view->set_attribute( name = 'lv_id'
                               value = m_usrid ).
  default_view->set_attribute( name = 'lv_dept'
                               value = m_usrdept ).
  default_view->set_attribute( name = 'lv_global_menu'
                               value = m_global_menu ).
* Call view
  call_view( default_view ).
My page displays wonderfully and I see everything with all my data.
It's just not jumping in to process that dropdownlistBox
                      <phtmlb:comboBox id                 = "MyGlobalMenu"
                                       table              = "<%= lv_global_menu %>"
                                       nameOfKeyColumn    = "menu_id"
                                       nameOfValueColumn  = "menu_img"
                                       nameOfValue2Column = "menu_text"
                                       onSelect           = "MyGlobalMenuSelect" />
Here the code is ComboBox but either way.  The DO_HANDLE_EVENT just doesn't fire.

Similar Messages

  • Pop Up Error using MVC method after Validation in  DO_HANDLE_EVENT Method

    Hi Experts,.
    I am rather new to BSP applications and I am working using MVC at the moment. I have a requirement which apparently is simple, but am yet to get that done successfully.
    I have a couple of buttons on my BSP View screen, on click of these buttons, the User Name would be verified with entries in a Custom table and if the User Name is not found, an error message would pop up stating, "You are not Authorized to use this option".
    On click of the button, the event which is triggered is handled in the DO_HANDLE_EVENT Method of the Controller for the view.
    The check is performed in that method. Thereafter the method DO_REQUEST follows automatically which loads the view yet again. I want to throw a pop up error message at this instance if the User Name was not the authorized one.
    I have used Java Script to throw pop up message but only in case of field content validation where I did not need to navigate away from the view for the validations. But how do I bo about for this example.
    Any help would be highly appreciated.
    Regards,
    Subhrangsu

    Hi
    1. You can call the view in pop-up because you will be calling the controller using open.window.
    Here is the sample code:
    method DO_REQUEST .
      data:
            li_vw           type ref to   if_bsp_page,
            lv_form_field   type          string,
            li_md           type ref to   zcl_model01.
      dispatch_input( ).
      li_md ?= get_model( 'm01' ).
      lv_form_field = request->get_form_field( 'invoice_create' ).
      if lv_form_field is initial.
    *------ Request to display main page
        li_vw = create_view( view_name = 'main.htm' ).
        li_vw->set_attribute( name = 'model' value = li_md ).
        call_view( li_vw ).
      elseif lv_form_field eq 'true'.
    *------ Request to display Invoice page in pop-up
        li_vw = create_view( view_name = 'invoice.htm' ).
        li_vw->set_attribute( name = 'model' value = li_md ).
        call_view( li_vw ).
      endif.
    endmethod.
    Layout :
       function do_Invoice()
          { var s=0; r=1; w=300; h=300; x=screen.width/2;
            x=x-w/2;
            var y=screen.height/4;
            y=y-h/2;
            popUp=window.open('main.do?invoice_create=true','win','width='+ w
            +',height='+ h +', left=' + x +',top='+ y +');
    Regards,
    G. Nikhil Kumar

  • File Upload issue in MVC

    Hi,
    For my MVC application, I have created a main controller.
    On the DO_REQUEST of the main controller, I am setting the sub controllers, and directly calling that controller using create_controller, controller_set_active, and call_controller.
    I included dispatch_input( ) in the Main controller's DO_REQUEST method.
    Inside the DO_REQUEST  of the sub controller, I am creating a view using create_view and call_view methods.
    In this view, I have a <htmlb:tableView /> and a <htmlb:fileUpload />, with a button. The issue is that, when the button is clicked, in the DO_HANDLE_EVENT method of the sub-controller, I am not getting the File Data, or the table data.
    For File upload, I use the following -
    data lv_fupld_data TYPE REF TO cl_htmlb_fileupload.
    lv_fupld_data ?= cl_htmlb_manager=>get_data(
                          request = runtime->server->request
                          name    = 'fileupload'
                          id      = 'fupld_1').
    I have the <htmlb:form method       = "post"
                      encodingType = "multipart/form-data" > etc in the view.
    When I call this sub-controller directly from the browser (after including the dispatch_input( ) part in DO_REQUEST), I do not get any issue. I am able to read the file data and upload the file.
    Any Idea why this is happening?

    Hi Rakesh,
    I think I got your problem:
    You only have the htmlb:form in your view of the subcontroller, and not in the main view.
    Therefore the subcontroller works by itself, but not within the main controller.
    If you are including subcontrollers, then make sure the form element is only present in the view of the main controller, wrapping around any subcontroller calls. And don't use the form tag anymore in the subcontrollers.
    Just as you put dispatch_input() just in your top controller, also place htmlb:form only in your top view.
    Regards,
    Max

  • BSP-MVC download to excel

    Hello experts,
    I know there are many threads on this topic in the forum. I tried using method cl_bsp_utility=>download
    but nothing happens. Here is the scenario -
    1. I have BSP
    2. From Do_handle_event in controller class I am calling model method which handles downloading to excel.
    Please help as this is real showstopper for the application, I am developing.
    Thanks, in advance.
    Trupti

    Hi Gopal,
    Thanks for your reply.
    Tried the code you sent me. As I am using BSP-MVC, I am building method in controller class and with event handling calling the method that handles download to excel. But it is not doing anything at all.
    Thank you.
    Trupti

  • MVC Tableview Data Entry

    Hello,
    I am using mvc design pattern for my bsp application.
    Could you please provide me some direction as to how to create a view that will allow the user to maintain master data (insert, update, delete, select) using htmlb extension table view?
    Thanks,
    Partho

    Hi Partho,
    Here is the flow...
    1. User clicks on the insert radio button.
    2. The control goes to the controller from the view.
    3. In the controller you will call insert view page.
    Now...
    Insert View has an internal table as a page attribute which will hold the database records.
    In <b>DO_REQUEST method</b> method...
    append a blank line into the internal table.
    <i>(This will be used by the user to insert the values into the internal table.)</i>
    Populate the internal table from the database...
    Now the internal table has a blank line followed by records that are already present in the internal table.
    Now the user sees a page containing the table view along with the save button.
    Now when the user clicks the blank line then in the <b>iterator</b> use the below code
    when 'REVW_CODE'.
    IF p_edit_mode IS INITIAL.
    p_edit_mode is not initial if the user selects a row from the table view.
    First you have to indentify that user has clicked the blank line. For this you can use
    if c_row_ref->REVW_CODE is initial
    or alreay generated value, etc.,
    Now you have two options...Since this is a primary key you can automatically
    generate a primary key or leave it to the user. If your table is a foreign key table then you can
    replace this cell to a drop down list box. the drop down list box contains the values from
    the primary key table
    endcase.
    After user enters all the values....
    He clicks Save button.
    Now in <b>DO_HANDLE_EVENT</b> method
    1. Catch this button event...
    2. In the controller you can get the values that are present in the table view using the method...
    GET_CELL_VALUE of cl_htmlb_event_tableview Class.
    3. Check if the primary key value already exists in the database.
    4. If yes. Show the user an error page with a back button. when he clicks it he will again reach the insert view page.
    5.If no. Populate the user values into a work area.
    6.Modify the internal table at index 1 from the work area.
    7.modify the database table from the internal table.
    8.Show a success page with a back button which will go to the main page with the radio buttons...
    Hope it helps.
    Regards,
    Maheswaran.B
    Message was edited by: Maheswaran B
    Message was edited by: Maheswaran B

  • Uploaded text file has a new line added at the top using BSP MVC applicatio

    I have a BSP MVC application that uploads data on to the application server. When I open the uploaded text file, the very first line on the file looks like the line below. ->
    htmlb:button:click:nullhtmlb_form_1UploadUpload0htmlbdfsdf
    But the rest of the file looks okay. This is causing other than .txt files to get corrupted.
    Here is the code from my DO_HANDLE_EVENT.
    data: entity   type ref to if_http_entity,
          name     type string,
          content  type xstring,
          content_type type string,
          idx      type i value 1,
          v_root(26) value '
    houappl131\SRM_Download\',
          v_unxfile(100),
          v_transfer type xstring,
          v_type(6),
          v_len type i,
          v_dirfile type zfileinfo,
          v_ofile(80),
          v_guid type guid_32.
      class cl_htmlb_manager definition load.
      data:        v_asn(10) type n.
      data: fu        type ref to cl_htmlb_fileupload,
                       file_id   type string value 'batchfile'.
      data: o_page_context type ref to if_bsp_page_context.
      data: parent type ref to cl_bsp_controller2,
            lo_model                       type ref to cl_sus_m_asn_detail.
      o_page_context = me->get_page_context( ).
      cl_htmlb_manager=>dispatch_event_ex( request = request
      page_context = o_page_context
      event_handler = me ).
      refresh z_batch->message.
      if htmlb_event->server_event = 'Upload'.
        fu ?= cl_htmlb_manager=>get_data( request = request id = file_id name
                                             = 'fileUpload' ).
        if fu->file_name gt space.
              z_batch->parameters-fpath = fu->file_name.
              v_len = strlen( z_batch->parameters-fpath ).
              if v_len gt 4.
                v_len = v_len - 3.
              endif.
              v_type = z_batch->parameters-fpath+v_len(3).
              search z_batch->parameters-fpath for '.'.
              if sy-fdpos gt 0 and v_len gt 0.
                v_len = v_len - sy-fdpos.
                v_type = z_batch->parameters-fpath+sy-fdpos(v_len).
              endif.
              clear v_asn.
              v_asn = z_batch->parameters-asnhdr.
              concatenate v_asn
                          z_batch->parameters-asnitem
                          z_batch->parameters-batch
                          v_type
                          into v_unxfile separated by '.'.
              concatenate v_root v_unxfile into v_unxfile.
              condense v_unxfile no-gaps.
              open dataset v_unxfile for output in binary mode.
                while idx <= request->num_multiparts( ).
                  entity = request->get_multipart( idx ).
                  name = fu->file_name .
                  if name is not initial.
                    content_type = entity->get_header_field( 'Content-Type' ).
                    clear content.
                    content      = entity->get_data( ).
                    v_transfer = content.
                    transfer content to v_unxfile.
                    append content to z_batch->filetab.
                  endif.
                  idx = idx + 1.
                endwhile.
                close dataset v_unxfile.
            endif.
      endif.
    Here is my fileupload button in the view
    <htmlb:page title="File Upload " >
        <htmlb:form method       = "post"
                    encodingType = "multipart/form-data" >
          <htmlb:label id     = "Batchnum"
                       design = "Label"
                       for    = "Batchnumber"
                       text   = "Batch" />
          <htmlb:inputField id    = "Batchinput"
                            value = "//zbatch/parameters.batch" />
          <htmlb:fileUpload id="batchfile" />
          <htmlb:button id      = "Upload"
                        text    = "Upload"
                        onClick = "Upload" />
          <htmlb:button id      = "Close"
                        text    = "Close window"
                        onClick = "Close" />
    Any of you gurus know why this is happening?

    I solved it myself

  • How to program navigation in a MVC application? (help please!!)

    Hi,
    I´m exploring how to develop a BSP application with MVC.
    SO far I have a ´page´ composed by a controller, 2 or more sub-controllers and their respective views.
    But I want an application consisting of many pages.. So here I am, in my DO_HANDLE_EVENT method wandering what to do when I want to redirect the user to a new page. I guess there´s two options here:
    1) change the subcontrollers/views for the new one. (using controller_set_active or controller_delete..?)
    2) redirecting to the new page with navigation->goto_page( 'page2.do' ).
    I like the second option, but there´s a problem: all my model instances die!! How can I keep them alive? How can I keep data (objects) alive from the moment a user opens the first page till he logs off the aplication??
    (I tried using the application class, but I just can´t access it using MVC, guess it´s only available from pages with flow logic)
    I truly need a hint on this! Any suggestions are most welcomed!

    Hi Mariana,
    I think the most important advice is to never jump
    directly via goto_page(). As you have noted, this way
    you lose your context. Myself I use the following
    approach:
    1) There is a strict controller hierarchy. The topmost
       controller holds your application data.
    2) In the view of the topmost controller its
       subcontrollers are called via
          <bsp:call url="sub.do" comp_id="yourchoicehere" >
                   <bsp:parameter name = "mode"
                                  value = "<%=mode%>" />
          </bsp:call>
       where "mode" is an attribute of the view which holds
       the information in which state of processing your
       application is.
    3) In the controllers in the DO_REQUEST methods
       you call its views by
       dispatch_input( ).
       l_main_view = create_view( view_name = 'main_view.htm' ).
      l_main_view->set_attribute( name = 'mode' value = mode ).
      call_view( l_main_view ).
      The dispatch_input method is only needed in the
      topmost controllers.
    4) Navigation is done by events which are passed
       automatically to the DO_HANDLE_EVENT method of
       the controller.
       IF htmlb_event IS BOUND.
          CASE htmlb_event->server_event.
            WHEN 'YOUREVENTHERE'.
    5) To understand how things work you should set
       breakpoints in all DO_HANDLE_EVENT and DO_REQUEST
       methods. You will see how events got passed upwards
       the controller hierarchy and how controllers call
       their subcontrollers.
    6) Further hint: Pass all parameters by controller
       and view attributes.
    Hope that helps.
    Joachim

  • MVC model / page with flow logic

    Hi all,
    I have started using MVC model in BSP application. Can anyone tell me the name of the controller methods corresponding to the following event handler methods(in case of page with flow logic):
    onCreate
    onRequest
    onInitialization
    onManipulation
    onInputProcessing
    onDestroy
    Thanks and Regards
    Shilpa

    Hi Shilpa,
    onRequest          -
    > DO_REQUEST
    onInitialization      -
    >  DO_INIT
    onInputProcessing  -
    > DO_HANDLE_EVENT
    onDestroy             ---> DO_DESTROY
    Thanks.

  • Operations in MVC

    experts,
    my requirement is to fire an event when click a button using MVC.
    Can any of you can send sample code.
    Thanks
    Vijaykumar Reddy. S

    Sample code.
    In the View the code will be like this. If the
    <htmlb:button id      = "dwnl"
                  onClick = "download"
                  text    = "Download to Excel"
                  tooltip = "Download to Excel" />
    In the DO_HANDLE_EVENT of the Corresponding controller the code will be like this.
    METHOD do_handle_event.
      DATA: lr_event        TYPE REF TO if_htmlb_data.
    * load htmlb_manager
      CLASS cl_htmlb_manager DEFINITION LOAD.
    * try to get a normal event
      lr_event = cl_htmlb_manager=>get_event( request ).
    *try to get extended event
      IF lr_event IS INITIAL.
        lr_event = cl_htmlb_manager=>get_event_ex( request ).
      ENDIF.
    * check if system have send an event
      IF lr_event IS INITIAL.
        RETURN.
      ENDIF.
    * Controller/View EVENT processing ....
      CASE lr_event->event_name.
        WHEN 'button'.
          CASE lr_event->event_id.
            WHEN 'dwnl'.
          ENDCASE.
       ENDCASE.
    hope this helps you.
    Amandeep
    <i><b>Reward points for each  helpful answer.</b></i>

  • How to debug a class method in MVC.

    hi,
    How to debug a method in MVC? When i execute the controller, it shd stops at the line in the method.
    Rgds,
    SAPUSER100

    Hi Koen,
    thnks again.now the debudder stops at DO_HANDLE_EVENT..but still the 'Page not displayed' error persists.
    Following is the code in DO_HANDLE_EVENT..
    <i>
    DATA: table_event type ref to CL_HTMLB_EVENT_TABLEVIEW.
      data period_mstr type yt_period_mstr.
      data wa type yperiod_mstr.
      data year_ref type bsindex.
      data rowselection type I.
    *period_mstr = me->period_mstr.
      IF htmlb_event is bound  AND
         htmlb_event->name = 'tableView'.
         table_event ?= htmlb_event.
         rowselection = table_event->selectedrowindex.
       read table period_mstr index rowselection into wa.
        me->year_ref = wa-year_ref.
      endif.
    rowselstion is correct..but my table is initial.
    help pls.
    </i>

  • MVC sub controller event handling for tabStrip

    Hi all,
    This is my first time on SDN so please forgive any procedural errors. I am developing an application for several dealer functions and use tabstrip and MVC. My main controller / view contains the tabstrip items and I call a seperate sub controller from the main view for each of the tabstrip items.
    (<bsp:call comp_id="track"/> where comp_id is a sub controller created in method do_init of the controller.) The sub controller classes were created using the MVC design pattern, each with a view and a model.
    Problem: When I am in any of the called sub controller views / tab items and I enter some data for the specific tab item, the do_handle_event method for that specific view / tab item sub controller is not activated. Processing goes directly to the do_handle_event of the main controller.
    My understanding of the process is that the do_handle_event for a sub controller will be activated first before processing return to the parent controller. This will allow me to use the tab items as independent views with the processing logic being handled by the relevant model. Am I correct in this assumption? I have read the forums on the handling of tabstrips and have looked at the sample applications but somehow I am missing a bit of the logic. Can someone please help?
    Regards,
    Jan van der Spuy

    Hello Bernhard/Shiva,
    I have changed the comp-id and debugged the DO_REQUEST event for main controller in more detail.
    The field values are
    htmlbevt_t<htmlb:button:click:null
    hmlbevt_f<htmlb_form_1
    htmlbevt_o<htmlb_button_1
    htmlbevt_i<onTracking
    htmlbevt_c<0
    onInputPro<htmlb
    tracking_t<9346100P&A
    tracking_t<1010
                     |
    m_subcontrollers[1]-INSTANCE
    METHOD DISPATCH INPUT
    Call registered controllers with form fields                           
    Call all registered controllers, even if no form_fields for them are r 
      LOOP AT m_subcontrollers ASSIGNING <controller> where hide = ''.       
       CHECK <controller>-fields[] IS NOT INITIAL.                         
        <controller>-instance->fill_values(                                  
                     form_fields = <controller>-fields                       
                     global_messages = component_messages ).     
    IF_BSP_CONTROLLER_FILL_VALUES(IF_BSP_CONTROLLER)
    performance shortcut if no subcontroller is present    
        if m_subcontrollers is intial.                        
          do_handle_data(                                      
            form_fields = form_fields                          
            global_messages = global_messages ).               
          return.                                              
        endif.    
    From here it goes to the DO_HANDLE_DATA method of  the subcontroller  and returns.
    A bit further in the logic of DISPATCH_INPUT() is where things go wrong.
    <b>* Dispatch event to controller</b>
      if event_value is not initial.
        if event_comp_index = 0.
         component_event = do_handle_event(                     
               event = event_value                   
         htmlb_event = request_event           
      htmlb_event_ex = event_data           
    global_messages = component_messages ).
                                                             And the values are as follows:
    component_event <b>(NO VALUE) IS THIS THE PROBLEM?</b>
    request_event      
    event_data         
    component_messages

  • How to clear the variables before closing a BSP MVC application

    I am calling a custom stateful BSP MVC application to display additional PO information as a popup window inside SAP BSP. When I close this popup window and open it later on a different PO, it still displays the old PO information. I am clearing the variables in the DO_HANDLE_EVENT. 
    I am using the javascript
    <htmlb:button id      = "Close"
                        text    = "Close window"
                        onClientClick="javascript:window.close()"  />
    to close the window.
    Could someone tell me what do I need to do before closing so that I can clear all the variables.

    Hi Krishana,
    Other neater way could be..
    instead of calling java script.. raise a server event.. in DO_HANDLE_EVENT set a flag <b>lv_close_window</b> to 'X'.
    on the page call the script to close the window if flag <b>lv_close_window</b> is set to 'X'.
    just before setting rhe flag to 'X' you can clear all unnecessary data.
    rememebr: javascript wont take you to DO_HANDLE_EVENT.
    <htmlb:button id = "Close"
    text = "Close window"
    onClick="close_window" />
    i would to this way if i am willing to go to DO_HANDLE_EVENT.
    A.

  • MVC Drop Down List Event Handler

    Hello,
    I am trying to create a bsp page using MVC design pattern. I have 3 drop down list fields which are dependent on each other. Example: When you select a value in list 1, drop down list 2 becomes enabled for selection with values based on list 1. At this point of time list 3 should be disabled. Once you select value from 2, list 3 becomes enabled with values based on list 2 selection.
    I have seen a webblog on this topic from Raja but it was designed for bsp page flow design. Could you please guide how do I achieve this in MVC?
    Please help.
    This is what I did:
    I have 1 controller and 1 view.
    In my view:
    =========================================================
    <htmlb:gridLayoutCell columnIndex="2" rowIndex="1">
    <htmlb:dropdownListBox id = "DDLB_PLANT"
             tooltip          = "Plant"
             table            = "<%= v_plants %>"
             onSelect         = "DDLB_PLANTEvent"
             selection        = "<%= v_plantsel %>">
             nameOfKeyColumn  = "WERKS"
             nameOfValueColumn= "DESC_TEXT">
    </htmlb:dropdownListBox>
    </htmlb:gridLayoutCell>
    <htmlb:gridLayoutCell columnIndex="2" rowIndex="2">
    <htmlb:dropdownListBox id = "DDLB_SHIFT"
             tooltip          = "Shift"
             table            = "<%= v_shifts %>"
             onSelect         = "DDLB_SHIFTEvent"
             selection        = "<%= v_shiftsel %>">
             nameOfKeyColumn  = "SHIFT"
             nameOfValueColumn= "SDESC">
    </htmlb:dropdownListBox>
    </htmlb:gridLayoutCell>
    where v_plants and v_shifts are page attributes (table) that is being populated in DO_REQUEST method of controller. v_plantsel and v_shiftsel are type string (page attribute).
    In DO_HANDLE_EVENT (controller)
    DATA: event_id   TYPE REF TO if_htmlb_data,
          ddlb_event TYPE REF TO cl_htmlb_event_selection,
          data       TYPE REF TO cl_htmlb_dropdownlistbox.
    event_id = cl_htmlb_manager=>get_event( request ).
    IF event_id IS NOT INITIAL.
       ddlb_event ?= event_id.
       IF ddlb_event->id EQ 'DDLB_PLANTEvent'.
          c_plantsel = ddlb_event->selection.
       ELSEIF ddlb_event->id EQ 'DDLB_SHIFTEvent'.
          c_shiftsel = ddlb_event->selection.
          CLEAR data.
          data ?= cl_htmlb_manager=>get_data( request      = runtime->server->request
    name         = 'dropdownListBox'
    id           = 'DDLB_PLANTEvent'
    IF data IS NOT INITIAL.
      c_plantsel = data->selection.
    ENDIF.
    ENDIF.
    ENDIF.
    =========================================================
    Thanks,
    Partho

    I though I was able to bind my dropdown return value but this is the error I am getting:
    "Field symbol has not yet been assigned"
    Here is what I am doing:
    Model
    =====
    populate plants
      SELECT werks name1
      FROM   T001W
      INTO   TABLE M_PLANTS
      order by name1.
      where m_plants & m_plantcode has been defined as model attributes.
    Controller
    ==========
    DO_INIT
    *create model instance
    cmodelsetup ?= create_model( model_id   = 'm'
                                 class_name = 'ZPES_SETUP_MODEL' ).
    if cmodelsetup is bound.
       cmodelsetup->getplants( ).
    endif.
    DO_REQUEST
    data: v_setupreview type ref to if_bsp_page.
    dispatch_input( ).
    if is_navigation_requested( ) is not initial.
       return.
    endif.
    create view instance
    v_setupreview = create_view( view_name = 'zsetupreview.htm').
    v_setupreview->set_attribute( name = 'vmodelsetup'      value = cmodelsetup ).
    call_view( v_setupreview ).
    View
    ====
                  <htmlb:gridLayoutCell columnIndex="1" rowIndex="1">
                     <htmlb:label for = "plant" text="Plant" />
                  </htmlb:gridLayoutCell>
                  <htmlb:gridLayoutCell columnIndex="2" rowIndex="1">
                      <htmlb:dropdownListBox id        = "DDLB_PLANT"
                                      tooltip          = "Plant"
                                      table            = "//vmodelsetup/m_plants"
                                      onSelect         = "DDLB_PLANT"
                                      selection        = "//vmodelsetup/m_plantcode"
                                      nameOfKeyColumn  = "WERKS"
                                      nameOfValueColumn= "DESC_TEXT">
                      </htmlb:dropdownListBox>
                  </htmlb:gridLayoutCell>
    PLEASE HELP!!!
    Thanks,
    Partho

  • BSP MVC app -- debug issue

    Hello,
    I have an BSP MVC stateless app. It has 4 views: Initial, Start, REsult and Detail. Initial view encompasses the other 3 views. When a value is entered in the Start view and on hitting 'Get results' I want to debugger to stop. I assign an external breakpoint there -- but it still doesn't stop their on the DO_HANDLE_EVENT event. The debugger on other events like DO_INIT stops BUT not on handle event method.
    I do have other app similar to the one above but the type is of stateful and the debugger on the same event works fine.  Please advise on how to make it work in BSP MVC stateless apps on certain events.
    Thank you.
    Kshitij

    Hello,
    Yes I do have dispatch_input() in the DO_REQUEST method of view Initial. But still the debugger doesn't stop at the DO_HANDLE_EVENT method.
    method DO_REQUEST.
    *CALL METHOD SUPER->DO_REQUEST
      data start_view TYPE REF TO if_bsp_page.
      dispatch_input( ).
      start_view = create_view( view_name = 'start.htm' ).
      start_view->set_attribute( name = 'pernr_low' value = me->pernr_low ).
      start_view->set_attribute( name = 'pernr_high' value = me->pernr_high ).
      call_view( start_view ).
    endmethod.
    Thank you.
    Kshitij

  • Calling standard funtion module in BSP using MVC Design pattern

    HI Everyone,
    I am trying to create one BSP application using MVC Design pattern,
    I want to call standard function module LSO_TRAINING_GET_DETAIL_C, in my BSP Model class,
    can any one tell me how to do this?
    I want to do the model binding also,like i want to retrive data on the frontend bsp screen from the above function module.
    Thanks,
    Vinay
    Edited by: vinay kumar on Jul 3, 2008 12:02 AM

    Hi Vinay,
    If you want to call the FM on some user action , ie on some event than you have to do it in
    DO_HANDLE_EVENT method of your controller class.
    For eg. if you want to call the FM on click of the button, you can do some thing like:
    DATA: button_event TYPE REF TO cl_htmlb_event_button.
    IF htmlb_event IS NOT INITIAL.
      IF htmlb_event->name = 'button'.
          button_event ?= htmlb_event.
         IF htmlb_event->server_event CP 'press'.
              call function LSO_TRAINING_GET_DETAIL_C
                                        exporting
                                         param_exp = val1
                                        importing
                                           param_imp = val2.
                  endif.
          endif.
    endif.
    here press is the OnClick event of the button.
    Now you can use this VAL2 , in the view .You can use the  HTMLB:TABLEVIEW element , if your FM's importing param is a table.
    Hope it helps a bit,
    BE,
    Anubhav.

Maybe you are looking for