Dear,
I tried to get the cell value when user clicks on a row in a table view by get_cell_value method but it always returns null. Does any one can help me?
My code is:
BSP Page:
<htmlb:tableView id = "tv1"
headerText = "List of Employees"
headerVisible = "true"
footerVisible = "true"
design = "alternating"
visibleRowCount = "20"
table = "<%= employee %>"
onRowSelection = "rowSelection"
selectionMode = "SINGLESELECT">
<htmlb:tableViewColumns>
<htmlb:tableViewColumn columnName = "empid" title = "ID">
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "firstname" title = "First Name">
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "lastname" title = "Last Name">
</htmlb:tableViewColumn>
</htmlb:tableViewColumns>
</htmlb:tableView>
OnInputProcessing:
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->name = 'tableView'.
IF event->event_type = 'rowSelection'.
DATA:
selrow TYPE REF TO cl_htmlb_tableview.
selrow ?= cl_htmlb_manager=>get_data( request = request
name = 'tableView'
id = 'tv1' ).
DATA:
tv_data TYPE REF TO cl_htmlb_event_tableview,
selected_row_index TYPE i,
empid TYPE string.
tv_data = selrow->data.
selected_row_index = tv_data->selectedrowindex.
CALL METHOD tv_data->get_cell_value
EXPORTING
row_index = selected_row_index
column_index = '1'
receiving
value = empid
.
navigation->set_parameter( name = 'empid' value = empid ).
navigation->next_page( 'TOCONTACT' ).
ENDIF.
ENDIF.
ENDIF.
Request clarification before answering.
if you look at the source of the get_cell_data method, you will see that it uses get_form_field method which requires the field to be read should be html input element. however when a non editable tableview is rendered, it doesnt render input elements, so this method wont work for non editable tables.
to read a particular cell value from the table view use the approach explained in the following thread
Regards
Raja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.