MVC  tableView /selectedRows

Hello All,
I use the <b>MVC Logic</b> and I try know to read the selectedRows from TableView, when I push a Button "<b>myButton</b>".
Thank's in Advance.
dav.

Hello Sreekanth .
Sorry!! but I need your Help!!
when I use your Code work perfect, but if I expand it, then does not work.
I mean if I call  the controller(zsk_temp1.do ) from a View (default.htm).
My Aplication has 2 Controllers and 2 views:
<u><b>Controller:</b></u>
    - default.do
    - zsk_temp1.do
<u><b>View:</b></u>
   -default.htm
   -First.htm
Have you any Idea why can i not get know the selected Rows???
I think is somting with "<u>dispatch_input( )."</u>
Thank's
Regards.
dav.
<b><u>View: First.htm</u></b>
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2003" >
  <htmlb:page title="First page " >
    <htmlb:form>
      <htmlb:textView text   = "Hello World!"
                      design = "EMPHASIZED" />
      <htmlb:button text    = "Press Me"
                    onClick = "myClickHandler" />
      <htmlb:group id     = "rate_zwei"
                   design = "sapcolor" >
        <htmlb:groupHeader>
          <htmlb:textView id        = "testgroup2"
                          text      = "Test group"
                          textColor = "black"
                          layout    = "PARAGRAPH"
                          width     = "400" />
        </htmlb:groupHeader>
        <htmlb:groupBody>
          <htmlb:tableView id                    = "tv1"
                           width                 = "100%"
                           visibleRowCount       = "8"
                           design                = "ALTERNATING"
                           footerVisible         = "TRUE"
                           selectionMode         = "MULTISELECT"
                           table                 = "<%= controller->itab_flight %>"
                           selectedRowIndexTable = "<%= controller->TABLE %>"
                           selectedRowIndex      = "<%= controller->v_index %>" >
          </htmlb:tableView>
          <p>
          <htmlb:button id      = "test"
                        onClick = "test"
                        text    = "test" />
        </htmlb:groupBody>
      </htmlb:group>
    </htmlb:form>
  </htmlb:page>
</htmlb:content>
<u><b>View : default.htm</b></u>
<%@extension name="bsp" prefix="bsp" %>
<%@extension name="htmlb" prefix="htmlb" %>
<%@extension name="phtmlb" prefix="phtmlb" %>
<htmlb:content id     = "ComponentTest"
               design = "CLASSIC+DESIGN2002+DESIGN2003" >
  <htmlb:page title="TEST" >
    <htmlb:form id           = "myFormId"
                method       = "post"
                encodingType = "multipart/form-data" >
     <htmlb:tray id          = "tray1"
                  title       = "Merkmale "
                  design      = "form"
                  width       = "100%"
                  isCollapsed = "false" >
        <b><bsp:call url     = "zsk_temp1.do"
                  comp_id = "zsk" ></b>        </bsp:call>
      </htmlb:tray>
    </htmlb:form>
  </htmlb:page>
</htmlb:content>
<u><b>Controller: default.do</b></u>
method DO_REQUEST.
  DATA: main_view TYPE REF TO if_bsp_page.
  dispatch_input( ).
  main_view = create_view( view_name = 'default.htm' ).
  call_view( main_view ).
endmethod.
<u><b>Controller: zsk_temp1.do</b></u>
ZCL_SREE_FIRST
Controller Class for zsk_temp1
INHERITED FROM:CL_BSP_CONTROLLER2
CLASS IMPLEMENTAION
" local class implementation for public class
" use this source file for the implementation part of
" local helper classes
CLASS TYPES
" use this source file for any type declarations (class
" definitions, interfaces or data types) you need for method
" implementation or private method's signature
CLASS MACROS
" use this source file for any macro definitions you need
" in the implementation part of the class
ATTRIBUTES
ITAB_FLIGHT                   INSTANCE ATTRIBUTE  PUBLIC         TYPE           ZSFLIGHT                                                                                sflight
INDEX                         INSTANCE ATTRIBUTE  PUBLIC         TYPE           S_INDEX
TABLE                         INSTANCE ATTRIBUTE  PUBLIC         TYPE           INT4_TABLE                                                                                Standard Table of INT4
V_INDEX                       INSTANCE ATTRIBUTE  PUBLIC         TYPE           SY-INDEX                                                                                Loops, Current Loop Pass
METHODS
method do_handle_data.
*CALL METHOD SUPER->DO_HANDLE_DATA
EXPORTING
   FORM_FIELDS     =
   GLOBAL_MESSAGES =
data: it_formfields type ihttpnvp.
read table form_fields into it_formfields with key name = 'tv1'.
endmethod.
method do_handle_event.
  data:
  table_event  type      ref to cl_htmlb_event_tableview,
  table        type      ref to cl_htmlb_tableview ,
  selectedrows type      selectedrows.
  case event.
    when 'test'.
      table ?= cl_htmlb_manager=>get_data( request = request
                                         name    = 'tableView'
                                         id      = 'tv1' ).
      table_event ?= table->data.
      call method table_event->get_rows_selected
        receiving
          selected_rows = selectedrows.
  endcase.
endmethod.
method do_init.
*CALL METHOD SUPER->DO_INIT
  select mandt
         carrid
        connid
  fldate
  price
  currency
  planetype
  seatsmax
  seatsocc
  paymentsum
  seatsmax_b
  seatsocc_b
  seatsmax_f
  seatsocc_f
  up to 10 rows
  from sflight
  into table itab_flight.
endmethod.
method do_request.
*CALL METHOD SUPER->DO_REQUEST
*write( '<html><body> ' ).
    write( 'This is my very first controller' ).
    write( '</body></html>' ).
  data: myview type ref to if_bsp_page.
  dispatch_input( ).
  myview = create_view( view_name = 'First.htm' ).
  call_view( myview ).
endmethod.
EVENTS
TYPE-GROUPS
INTERNAL TYPES
S_INDEX                                           PUBLIC

Similar Messages

  • Problem in capturing Tableview Selectedrow contents

    Hi I am experiencing problem in capturing the contents of the selected row in the tableview. My Code looks like as follows:
    <b>Layout</b>
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
    <%--  <%@include file="head.htm" %> --%>
      <htmlb:page title="Company Code Search " >
        <htmlb:form>
          <htmlb:label for      = "l_CCODE"
                       text     = "Field"
                       tooltip  = "User ID"
                       required = "X"
                       width    = "100px"
                       design   = "EMPHASIZED" />
          <htmlb:dropdownListBox id = "ddname">
            <htmlb:listBoxItem key   = "li_bukrs"
                               value = "Company Code" />
            <htmlb:listBoxItem key   = "li_butxt"
                               value = "Company Code Description" />
          </htmlb:dropdownListBox>
          <htmlb:inputField id    = "i_search"
                            value = "Search term" />
          <htmlb:button id      = "b_search"
                        text    = "Search"
                        tooltip = "click here to start the search"
                        onClick = "onInputProcessing(select)" />
          <br>
          <htmlb:tableView id              = "tv_tabid"
                           table           = "<%= gt_t001 %>"
                           design          = "STANDARD"
                           designMode      = "HTMLB"
                           allRowsEditable = "TRUE"
                           tableLayout     = "AUTO"
                           width           = "75%"
                           visibleFirstRow = "1"
                           visibleRowCount = "10"
                           headerVisible   = "TRUE"
                           headerText      = "Company Code Selection Table"
                           onRowSelection  = "onInputProcessing(select)"
                           selectionMode   = "SINGLESELECT"
                           selectedRowKey  = "wa-BUKRS"
                           navigationMode  = "BYPAGE"
                           footerVisible   = "TRUE" >
            <htmlb:tableViewColumn columnName="BUKRS"
                                        title= "Company Code">
            </htmlb:tableViewColumn>
            <htmlb:tableViewColumn columnName="BUTXT"
                                        title= "Description">
            </htmlb:tableViewColumn>
          </htmlb:tableView>
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    <b>OnInputProcessing</b>
    event = cl_htmlb_manager=>get_event( request ).
    CASE event->id.
      WHEN 'b_search'.
        DATA: l_ccode TYPE REF TO cl_htmlb_inputfield.
        DATA: l_id TYPE REF TO cl_htmlb_dropdownlistbox.
        l_ccode ?= cl_htmlb_manager=>get_data( request = runtime->server->request
                                              name    = 'inputField'
                                              id      = 'i_search' ).
        l_id ?= cl_htmlb_manager=>get_data( request = runtime->server->request
                                            name    = 'dropdownListBox'
                                            id      = 'ddname' ).
        ls_listvalue = l_id->selection.
        IF NOT  l_ccode->value IS INITIAL.
          IF ls_listvalue = 'li_bukrs'.
            ls_name = l_ccode->value.
          ENDIF.
    * Read Data into internal table by search term
       Select * from T001 into table gt_t001 where bukrs = ls_name.
        ENDIF.
      WHEN 'tv_tabid'.
        DATA: tv_table TYPE REF TO cl_htmlb_tableview.
        DATA: table_event TYPE REF TO cl_htmlb_event_tableview.
        DATA: selectedrowindex TYPE i.
        tv_table ?= cl_htmlb_manager=>get_data( request = runtime->server->request
                                             name    = 'tableView'
                                             id      = 'tv_tabid' ).
        IF tv_table IS NOT INITIAL.
          table_event = tv_table->data.
          selectedrowindex = table_event->selectedrowindex.
    * Read Table gt_t001 into Work Area and Pass the selected value through Navigator
          READ TABLE gt_t001 INTO wa_t001 INDEX selectedrowindex.
          navigation->set_parameter( name = 'nv_bukrs' value = 'samp').
          navigation->goto_page( 'FormRequest.bsp' ).
        ENDIF.
    ENDCASE.
    When I selected a row in the tableview, I am getting the selectedrow Index (selectedrowindex = table_event->selectedrowindex.). But the Values in the table gt_t001 are disapperiaring to read the contents by selectedrowindex.
    Is there a way of capturing the contents of selected row or if I am doing any wrong in loosing the data from internal table.
    Please help.

    Hi Gireesh,
        I will give you a sample code which i have practiced for the same reqirement...
    Oninputprocessing:
    if event->name = 'tableView' and event->event_type = 'rowSelection'.
        data : data2 type ref to cl_htmlb_tableview.
        DATA: tv_data TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.
        data2 ?= cl_htmlb_manager=>get_data(
                                request = request
                                name    = 'tableView'
                                id      = 'tview' ).
         clear tv_data.
         if not data2 is initial.
             tv_data = data2->data.
             clear wa1.
             read table it_mara3 into wa1 index tv_data->row_index.
               if sy-subrc = 0.
                  v_matnr1 = wa1-matnr.
                  call method navigation->set_parameter
                   exporting
                   name = 'v_matnr1'
                   value = v_matnr1.
                   navigation->goto_page( 'third.htm' ).
                endif.
          endif.
       endif.
    where wa1 is a workarea declared as page attribute.
    and every thing is correct in layout except one thing that i have added one more attribute to the tableview that is...
    onNavigate="onMyNavigation"
    ADD THE CODE WHAT EVER REQUIRED BY SEEING THE EXAMPLE GIVEN...YOU WILL GET THE SOLUTION.
    Regards,
    Azaz Ali.

  • MVC Tableview Singleselect and sorting

    Dear all,
    I have a tableview defined as follows:
    <htmlb:tableView id              = "result"
                     design          = "ALTERNATING"
                     keepSelectedRow = "true"
                     headerText      = "Header Text"
                     onNavigate      = "onMyNavigate"
                     selectionMode   = "SINGLESELECT"
                     emptyTableText  = "Keine Daten selektiert"
                     fillUpEmptyRows = "true"
                     filter          = "Server"
                     sort            = "Server"
                     keyColumn       = "pernr"
                     selectedRowKey  = "//aref_model/awa_persdata.pernr"
                     onRowSelection  = "onMyRowSelection"
                     table           = "//aref_model/ait_persdata"
                     iterator        = "<%= aref_iterator %>"
                     visibleRowCount = "5" >
    On my first approach I had simply the singleselect and found out that after resorting the index number remain the same (thus another person was marked selected). To overcome the problem I added the selectedRowKey but before I added keyColumn the entries in selectionRowKey remained initial. Now, I can see (while debugging in DO_HANDLE_EVENT that the attributes are set, (even the page displays the different person in another tray. However, the line is not marked anymore.
    Am I on a completly wrong track here? Could you give me some hints or directions? I checked the SBSPEXT_TABLE but it seems to work different since there is no MVC behind.
    Christian

    Dear all,
    I have solved the issue (rather accidently):
    Obviously the model binding does not work for the attibute selectedRowKey.
    I changed it
    from
    <htmlb:tableView id              = "result"
                     design          = "ALTERNATING"
                     keepSelectedRow = "true"
                     headerText      = "Header Text"
                     onNavigate      = "onMyNavigate"
                     selectionMode   = "SINGLESELECT"
                     emptyTableText  = "Keine Daten selektiert"
                     fillUpEmptyRows = "true"
                     filter          = "Server"
                     sort            = "Server"
                     keyColumn       = "pernr"
                     selectedRowKey  = "//aref_model/awa_persdata.pernr"
                     onRowSelection  = "onMyRowSelection"
                     table           = "//aref_model/ait_persdata"
                     iterator        = "<%= aref_iterator %>"
                     visibleRowCount = "5" >
    to
    <htmlb:tableView id              = "result"
                     design          = "ALTERNATING"
                     keepSelectedRow = "true"
                     headerText      = "Header Text"
                     onNavigate      = "onMyNavigate"
                     selectionMode   = "SINGLESELECT"
                     emptyTableText  = "Keine Daten selektiert"
                     fillUpEmptyRows = "true"
                     filter          = "Server"
                     sort            = "Server"
                     keyColumn       = "pernr"
                     selectedRowKey  = <b>"<%=aref_model->awa_persdata-pernr %>"</b>
                     onRowSelection  = "onMyRowSelection"
                     table           = "//aref_model/ait_persdata"
                     iterator        = "<%= aref_iterator %>"
                     visibleRowCount = "5" >
    and now it works....
    Christian
    Message was edited by: Christian Finkbeiner

  • 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

  • Having problem with two Tableview controls.

    Hi all,
    I have two tableview controls in my page. TV1 has list of employees. TV2 is populated with details based on the employee selected in TV1.
    The actual problem is, in TV1 when i goto next page using navigator and select an employee in 15th row, and select a detail row from TV2, TV1 gets refreshed and goes back to row 1.
    How can i avoid this?
    Thanks & Regards,
    Lalith

    Hi,
    you can bind the attribute of the tableView selectedRow = "//model/selected_row"
    to an attribute in your model class
    that way you can always find your selection if working stateful
    grtz
    Koen

  • TableView: ITERATOR in MVC

    Using the MVC design pattern, ITERATOR methods (e.g. IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START) can be implemented in the Controller, in the Model or in a seprated class.
    I give my vote to the CONTROLLER...
    And you, which is the best place where to implement it?
    Sergio

    Hi Sergio,
    it depends on what exactly you want to do in your methods.
    For pure tableview rendering problems I would recommend leaving it in the iterator.
    I try to keep my application's methods well structured and always in the class they do belong most to - thinking about placing iterator methods somewhere else is something I have not thought of before, and I don't think I will do so anytime ...
    Using the controller as you suggested ... not so appropriate imo, as a controller was introduced to separate display and application code, and the iterator is used to change display/rendering of a tableview.
    Max

  • How to hide a column (clnt) in tableview using MVC?

    Hy,
    I would like, please if you cand help me: how to hide a column (clnt) in tableview using MVC for example on sflight table.
    Thanks

    Hi,
    You can use the below logic
    <htmlb:tableView id = "t1"
               visibleRowCount = "10"
               table = "<%= flights %>">
         <htmlb:tableViewColumns>
              <htmlb:tableViewColumn columnNamd = "carrid" />
              <htmlb:tableViewColumn columnNamd = "connid" />
              <htmlb:tableViewColumn columnNamd = "fldate" />
         </htmlb:tableViewColumns>
    </htmlb:tableView>
    define all the required columns using tableViewColumn tag.
    Regards,
    Ravi

  • TableView in MVC - how to bind view to controller data?

    Hi,
    I have a default view in my BSP with a tableView on it. I have set the table and iterator variables. In the controller DO_INIT I am selecting the reqd data - how do I pass this data to my table view?
    I have created a iterator class and implemented the required methods - how should I use this iterator class to move the data to the view.
    In the DO_REQUEST method I am setting the attributes for the view - the table values and also iterator attribute, but its not working...
    Thanks
    Kiran

    All right we will try this one question at a time:
    >How do I use the iterator, where do I implement the std. methods of the iterator interface.
    I think that has already been answered in another thread after your question. But just to be clear, the iterator is generally a completly separate class that implements the interface IF_HTMLB_TABLEVIEW_ITERATOR.  I said generally, because technically this can be any object that implements this interface.  You could implement this interface in your model, your controller, or your application class - but this is not advised.  I like to create a separate class and instaniate it either in my model or my application class.  I store the object reference as an attribute of the hosting object.  This makes the iterator easily accessible when you need it.
    >How will my view know that it has to use the iterator class that I create?
    It doesn't.  Nor does it need to.  The view has nothing to do with the iterator.  The iterator is not a general method for generating Extension Elemetns (that is what the BEE is for).  The iterator class is specific to the element htmlb:tableView and can only be used with this element.  The Iterator instance is passed into the tableView during the definition of this element in the view.  The class behind the tableView will then use and interact with the iterator class at the correct times.  The table will pass the correct data into the iterator object so that the iterator can pass over either the column, the row, or the cell (the three different methods of the interface) and change the rendering of the tableView.
    >I am new to MVC and dont know how to create biding between view & model attribute.
    Yes Data binding is done between a view and a model (the model's attributes) not the controller. Data binding is very useful as metadata about fields can be consumed automatically by UI elements in the View.  It also handles Input Handleing for you.  I can't explain the entire concept of MVC and databind in a thread posting - as that wouldn't do it justice. However there are blogs, on-help and chapters in certain BSP Books dedicated to just that topic.
    >Finally is the model class & application class one & the same?
    No they are very different objects with different purposes.  Application classes existed before MVC was supported by BSP.  You can have one and only one application class per BSP application.  They are used in stateful applications to store data and object references over the entire lifetime of the application.  They can also be holders for application logic that spans the entire application. However since the introduction of MVC (in release 6.20) they should take a back seat to full MVC.  MVC separates the presentation logic (view), flow and eventing (Controller) and Application Logic (Model) into separate objects.  In a BSP application you can have 0:n model objects.  Technically a model class is any standard ABAP class that inherits from CL_BSP_MODEL2.  You create them in the ABAP Editor like any other class. However the inheritance has methods that can be called by the BSP and MVC framework to perform functions like data binding.

  • Using TableView and MVC

    I have a problem with TableView. I use TableView to display a table which is an attribute of my model class.
    Code in the view looks like this:
      <htmlb:tableView
           id            = "TEST_ID"
           table         = "//model/t_selected_employees"
           selectionMode = "MULTISELECT" />.
    I also have a few buttons on this view, when the button is pressed in DO_HANDLE_EVENT method I append a line to table but when the next DO_HANDLE_DATA method occurs table flushes. All other parameters stay filled.
    Thank you for future help.

    your code in do_handle_event should luk like this now :
    ************Code .
    DATA:
    lt_string_table TYPE string_table.
    CHECK NOT event IS INITIAL.
    IF htmlb_event_ex->event_name = xhtmlb_events=>buttongroup AND
    htmlb_event_ex->event_type = xhtmlb_events=>buttongroup_click.
    DATA: ls LIKE LINE OF model->t_selected_employees.
    CASE htmlb_event_ex->event_defined.
    WHEN 'TEST'.
    call model->insert_line.
    ENDCASE.
    ENDIF.
    Code ends.
    in Model class create the insert_line methos and put your append code there as  :
    mothod insert_line.
    ls-num = 55. ls-pernr = '00001280'. ls-fio = 'TEST'.
    APPEND ls t_selected_employees.
    endmethod.

  • Tableview getting refreshed when changing data in the rows

    Hi Gurus,
    Iu2019m doing a BSP with MVC. The requirement is as below.
    In the main page there is a button u2018Create Orderu2019, to create a sales order, once I click this button, another screen (pop up) comes up and within that I have a Tableview display with the below fields with the data of 20 records.
    Material no
    Quantity
    Delivery Date
    Here user is allowed to choose the quantity and delivery date by selecting each row.(with MULTISELECT option in BSP)
    The issue is after I select first row and change the quantity and date, and if I click on second row, the Tableview gets refreshed to enable the second row to be editable and the changes what I did on the first row are also refreshed.
    So i want the Tableview not to be refreshed when selecting the multiple rows. So that I can keep the changes I make to the quantity and date fields Can you please suggest any method.
    Cheers,
    Srini.

    Hi Srinivas,
    You need to capture the value entered by user in Quantity and date field and update the internal table with these values for the current selected row.
    For ex.
    The tableView code is like:
                          <htmlb:tableView id                  = "material"
                                     headerText          = "<%= otr(Z_SUS/HEADER_TEXT_MATERIALS) %>"
                                     headerVisible       = "true"
                                     design              = "alternating"
                                     onRowSelection      = "MyEventRowSelection"
                                     selectionMode       = "MULTILINEEDIT"
                                     width               = "880"
                                     filter              = "SERVER"
                                     emptyTableText      = "<%= otr(Z_SUS/EMPTYTABLE_MATERIALS) %>"
                                     iterator            = "<%= iterator %>"
                                     table               = "<%= gt_materials %>" />
    In eventhandler OnInputProcessing :
    DATA: lt_fields type tihttpnvp ,
               ls_fields like line of lt_fields.
    call method request->get_form_fields
                changing
                  fields = lt_fields
    Now the internal table lt_fields contains all the editable cell values , just update the internal table of your tableview with these values.
    You can try these threads
    [Thread-I.|Re: Retrieve changes made in tableView]
    [Thread-II|https://forums.sdn.sap.com/click.jspa?searchID=24460585&messageID=5516977]
    Search the forum for more information on this.
    Regards,
    Anubhav

  • Issue with tableview data storing

    Hi,
    We are using MVC model, it has view-model-main controller and sub controller. I am displaying
    4 columns on the tableview where 2 columns are editable. when i click update button on the screen
    i have called do_handle_event method on sub controller, when i debug the code i am getting
    table as initial always. I am not sure what am i missing here..can any one help me ?
    Here is code
    method DO_HANDLE_EVENT
    data: o_event    type ref to cl_htmlb_event,
          visible_row type int4,
          visible_last_row type int4,
          visrow_count type int4 value 10,
          it_osha like line of it_mfgprf_osha,
          wa_osha type zpp1_mfgprf_osha,
          o_app  type ref to zcl_mfg_perf.
    o_event = cl_htmlb_manager=>get_event( request ).
        if o_event is not initial.
            if o_event->id = 'osha_update'.
                  data: tv type ref to cl_htmlb_tableview.
                  tv ?= cl_htmlb_manager=>get_data(
                              request      = runtime->server->request
                              name         = 'tableView'
                              id           = 'it_osha_history' ).
                    if tv is not initial.
                    data: tv_data type ref to cl_htmlb_event_tableview.
                    tv_data = tv->data.
                if it_mfgprf_osha is not initial.
                    visible_row = tv_data->visiblefirstrowindex.
                    visible_last_row = visrow_count + visible_row - 1.
                    loop at it_mfgprf_osha into it_osha
                          from visible_row to visible_last_row.
                    it_osha-zosha_ytd = tv_data->get_cell_value(
                                row_index    = sy-tabix column_index = 3 ).
                     endloop.
               endif.
                   endif.
                 endif.
         endif.
    view
                  <htmlb:tableView id              = "it_osha_history"
                                   table           = "<%=o_app->it_mfgprf_osha%>"
                                   iterator        = "<%=o_cont->osha_iterator%>"
                                   headerText      = "OSHA History"
                                   headerVisible   = "True"
                                   sort            = "SERVER"
                                   onHeaderClick   = "sort"
                                   visibleRowCount = "10"
                                   width           = "100%"
                                   design          = "ALTERNATING"
                                   allRowsEditable = "<%=o_app->ALLOW_RECORD_EDIT%>" />
    Thanks!
    Lakshmikandh

    Hi Guys,
    Thanks for valuable suggestion. Let me give you over view of application. We have sub-controller
    for all views, one controller and one model for those sub controllers and views.
    Hi Sebastian,
    Are you suggesting to use new model for all table view iterator ?
    If i use iterator on that one model i can't use
    that for other table view iterator..right ?
    Hi raju,
    If i get all the values on 'do_handle_data' method in the controller class, can i use that
    for other table view iterator if i create a new table view iterator?  can i have some
    outline(example coding) of passing those values to sub controller ?
    Thanks in advance.
    Lakshmikandh

  • Retrieving table values from tableview multiselect

    Hi everyone,
    I have a BSP with a tableView set on multiselect. When the user clicks on a button I want to rertieve the selected rows in my ABAP code and send them to a function module (in the form of a table). But I haven't been able to find code examples on how to do this, ie how to retrieve the selected rows. Can someone provide me with an example or a link to where I can find one? I can catch the button onClick event, but after that I need to get the rows that were selected by the user.
    Thanks!
    best regards,
    Dionisios

    HI Dionisios,
    In your input processing,
    do something like
    CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
    IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.
    DATA: event TYPE REF TO CL_HTMLB_EVENT.
    event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
    if  event->id = 'but1' and event->event_type = 'click'.
      DATA: tv TYPE REF TO CL_HTMLB_TABLEVIEW.
      tv ?= CL_HTMLB_MANAGER=>GET_DATA(
                      request      = runtime->server->request
                      name         = 'tableView'
                      id           = 'tab1' ).
    IF tv IS NOT INITIAL.
    DATA: tv_data TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.
      tv_data = tv->data.
    refresh itab2.
    refresh itab3.
    <b>call method tv_data->GET_ROWS_SELECTED
          receiving selected_rows = itab2.</b>
    endif.
    data : ind type SELECTEDROW,
           row_s type row.
    if itab2 is not initial.
        data :rw LIKE LINE OF itab.
        loop at itab2 into ind.
          READ TABLE itab INDEX ind-index into
          rw.
           if rw is not initial.
           row_s = rw.
          append row_s to itab3.
          clear row_s.
          endif.
        endloop.
    endif.
    Endif.
    Where
    TYPES
    types : tab type table of <table_name>.
    types : row type <table_name>.
    PAGE ATTRIBUTEs :
    Irow type row
    Itab type tab.
    Itab3 type tab.
    Itab2 type selectedrows.
    Rowselected type string.
    And in layout
    <htmlb:tableView id="tab1"
                      table="<%= itab %>"
    ="true" >
                     visibleRowCount="8"
                      design="ALTERNATING"
                      footerVisible="TRUE"
                     selectionMode="multiSelect"
                     keepSelectedRow
         </htmlb:tableView>
    <htmlb:button  id = "but1"
                   onClick="test"/>
    HOpe this helps,
    Regards,
    Siddhartha

  • Problem with iterator in tableview

    Hi, Im having a problem with an iterator in a tableview. Sometime ago I use an iterator in a BSP with flow logic, I created the class fill the methods GET_COLUMN_DEFINITIONS and RENDER_CELL_START. And worked fine.
    Now, Im working in another BSP and this time I wanted to use MVC, so I have been reading but cant figure it out what Im missing out.
    In the controller of my page I add the Interface IF_HTMLB_TABLEVIEW_ITERATOR
    I ridefine the methods GET_COLUMN_DEFINITIONS and RENDER_CELL_START (I think that you dont have to redifine GET_COLUMN_DEFINITIONS but did it anyway just in case).
    This is my RENDER_CELL_START
      IF NOT ( p_column_key = 'ICON' ).
        RETURN.
      ENDIF.
      FIELD-SYMBOLS: <row> TYPE ANY, <col> TYPE ANY.
      DATA: ti_results TYPE ZBSPREP_VEND_T,
                 wa_results TYPE ZBSPREP_VEND.
      ASSIGN p_row_data_ref->* TO <row>.
      ASSIGN COMPONENT p_column_key OF STRUCTURE <row> TO <col>.
      wa_results = <col>.
      DATA: html_bee TYPE REF TO CL_BSP_BEE_HTML.
      CREATE OBJECT html_bee.
      LOOP AT it_results INTO wa_results.
        icon = CL_BSP_MIMES=>SAP_ICON( id = 'ICON_GREEN_LIGHT' ).
      ENDLOOP.
      p_replacement_bee = CL_HTMLB_IMAGE=>FACTORY( id = p_cell_id src = icon ).
    In my table view the column ICON doesnt show anything and the rare part is if I put breakpoint in the method and execute the page doesnt stop.
    So I dont know if Im missing something.
    My tableview layout is this:
    <htmlb:tableView id             = "Monitor"
                                     selectionMode  = "SINGLESELECT"
                                     onRowSelection = "rowSelection"
                                     table          = "<%= it_results %>"
                                     iterator        = "<%= iterator  %>"
                                     design         = "ALTERNATING"
                                     filter         = "SERVER"
                                     sort           = "SERVER"
                                     headerVisible  = "FALSE"
                                     footerVisible  = "FALSE">
    I declare a attribute iterator TYPE IF_HTMLB_TABLEVIEW_ITERATOR.
    Someone could give a hand ?

    Solved, I forget to set the attribute of the view in the REQUEST Method.
    result_view->set_attribute( name = 'iterator' value = me ).

  • Set filter for only one column in tableview

    Hi
    i am using in MVC a htmlb:tableview with filter in only one column of 8.
    This is all working fine, except that the user can enter a searchsting in the filterfield for all columns, but in handle_event (of the controller) ; i only react to a text in the filterfield of column 4 and ignore all other filtertext , which were maybe entered in the other columns.
    My question:
    how can i  enter the filter only for one column, in a way that the user cannot enter any text in the filterfield of the other columns, only in column 4 ?
    my view:
    <htmlb:tableView id             = "requirements"
                     table          = "//model/pdst_reqs"
                     filter         = "APPLICATION"                
                     keyColumn       = "EXTID"
                     iterator        = "<%=model%>"
                     footerVisible   = "FALSE"
                     encode          = "TRUE"
                     visibleRowCount = "<%=model->rowcount%>"
                     width           = "100%"/>
    Best Regards
    Britta

    You can disbale the Filter for the particular column by setting the DISABLE_FILTER in the Iterator method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS. Here is the sample code
    method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS .
      CLEAR p_column_definitions.
      CLEAR p_overwrites.
      data tv_column TYPE TABLEVIEWCONTROL.
      tv_column-COLUMNNAME          = 'FLDATE'.
      tv_column-SORT                = 'X'.
      tv_column-EDIT                = 'X'.
      tv_column-ONCELLCLICK         = 'MyCellClick1'.
      tv_column-title               = 'Date '.
      APPEND tv_column TO p_column_definitions.
      CLEAR tv_column.
      tv_column-COLUMNNAME          = 'PRICE'.
      tv_column-horizontalAlignment = 'right'.
      tv_column-verticalAlignment   = 'middle'.
      tv_column-ONCELLCLICK         = 'MyCellClick2'.
      tv_column-title               = 'Currency'. 
      tv_column-EDIT                = 'X'.
      tv_column-DISABLE_FILTER      = 'X'.    " <-------Like this
      APPEND tv_column TO p_column_definitions.
    endmethod.
    Hope this will solve your problem.
    Raja

  • In MVC, do i need a View or Page with flow logic for POPUP window

    Hi All,
    I have the below scenario using the MVC pattern.
    I have a main view with 3 trays, each tray has two buttons, for example first tray has Create Order button. When I click on this button, I need a popup window to come with a tableview and a button(Create), where I select some rows and click on the button Create  to create order.
    But as per the MVC pattern I canu2019t call the view (popup) from another view(main view).  So should I create a VIEW or PAGE WITH FLOW LOGIC for the popup? .
    I need 6 popup to be called from the main view and once the function is done close the popup.
    Please suggest me the flow for this scenario.
    Cheers,
    Srini.

    Srini,
    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 +');
    Option2:
    Ofcourse you can't bind the model in page becos those are 2 different things. But all you need to do is access the model to get some value. To know how to access the model from Page w/flow logic look at [this link|Passing model reference to a page in a Popup].
    Raja
    Edited by: Raja Thangamani on Apr 14, 2009 11:22 AM

Maybe you are looking for

  • Active Directory 2012 R2: SMB1 Access for XP / Server 2003

    Hi there Experts I'm currently planning the migration of our 2008 R2 Domain Controller to 2012 R2. We also have a few XP / Server 2003 Clients in our Environment. I read on a few blog posts that there is a problem with XP and Server 2003 to access e.

  • I havent had itunes for a month because...

    itunes wont open EVEN when itunes AND quicktime are installed and updated! it pops up with something that says "iTunes has encountered a problem and needs to close. We are sorry for the inconvenience." im really getting mad because i keep installing

  • ABAP client proxy wildcard/unicode problem

    Hello, i have an abap client proxy. The target system is a non sap system. For one input field of the request, a wildcard search is possible (with sign %, field type = string). If i exceute the proxywith the wildcard sign '%' i get following error me

  • No audio out input on tv

    I am trying to assist my mother, to hook up her toshiba tv 32c11ou to a toshiba sd-v2976k dvd/vcr and she has cable without a cable box, how do you make the connections when the tv has no audio out

  • I have FIrefox 3.6.13 and it redirects to sites not requested; is it compromised?

    I tried to go to en,wikipedia.org/wiki/Greek_alphabet and something gets control and redirects to other sites or the last time a "rogue scanner" was stopped by AVG. The tab said "indianawars.com but AVG stopped the transmission. If I copy and past th