cancel
Showing results for 
Search instead for 
Did you mean: 

<htmlb:tableView> rowSelection ?

Former Member
0 Kudos

hi

i have a tableview

how can i take the value that clicked a row of table view ?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Mutlu,

Plesase chck this code.

DATA: event TYPE REF TO CL_HTMLB_EVENT,

tv_data type ref to CL_HTMLB_EVENT_TABLEVIEW.

if event->id = 'tv1'.

tv ?= CL_HTMLB_MANAGER=>GET_DATA(

request = runtime->server->request

name = 'tableView'

id = 'tv1' ).

if tv is not initial.

*the selected row value is in tv_data.

tv_data = tv->data.

v_index = tv_data->row_index.

endif.

endif.

Former Member
0 Kudos

Hi,

Try with the below logic represented below.

Have a column in the table view for, whether the row selected or not (eg. Include_exclude).

Use the below piece of code.



  In IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_ROW_START,
               m_row_ref ?= p_row_data_ref.
           
           In IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.
              DATA: CHK TYPE ZFLAG.
              case p_column_key.
              when 'INCLUDE_EXCLUDE'.
                   CHK = m_row_ref->INCLUDE_EXCLUDE.
                   p_replacement_bee = CL_HTMLB_CHECKBOX=>FACTORY(
                                                                                id            = p_cell_id
                                                                                checked   = CHK ).
           In Do Request
               Data: loc_table_event type ref to cl_htmlb_event_tableview. 
               Data: Selected type i.
               call method cl_hrrcf_iterator=>get_tv_attr
                    exporting
                             p_tv_id                  = '<Table View ID>'
                             p_component_id    = me->component_id
                             po_request            = me->request
                   importing
                             po_tv_event           = loc_table_event.
           
               Selected    =  loc_table_event->get_cell_value(
                                         row_index     = indv
                                        column_index  = 1 ).
          

Reward points if helpful.

Regards,

Gokul.N

former_member188685
Active Contributor
0 Kudos

did you check this application SBSPEXT_TABLE

in that check the Page TableViewClient.bsp

and also use search option. there are many threads available on the same topic.

Former Member
0 Kudos

thanks your recommend .

but i want to examine code.

so you can send example code

former_member184111
Active Contributor
0 Kudos

Hi,

event             TYPE REF TO if_htmlb_data.

in oninputprocessing you can read the index of row that is clicked in EVENT->EVENT_ID

it is of the form tableviewname_rownumber_columnumber.

Regards,

Anubhav.