on 03-23-2007 9:38 AM
Hi.
How can I recover the selected row in a internal table, with the htmlb:tableView, in the onInputProcessing?
Thanks very much!
I'm using this sentence in the "layout":
<!-- Visualizamos Línea de selección + tabla interna -->
<htmlb:tableView id = "myTableView"
visibleRowCount = "<%= c_ver_registros %>"
width = "<%= c_ancho_tabla %>"
selectionMode = "SINGLESELECT"
table = "<%= T_TABLA %>" >
</htmlb:tableView>
null
thanks, but it not works. It return TABLE_EVENT->PREVSELECTEDROWINDEXTABLE as initial.
I think that it not works by the names of table, but I don't know put it
Can you adapt the code to my tableView? Thanks.
I will see the Monday. My code is:
<htmlb:tableView id = "myTable"
visibleRowCount = "<%= c_ver_registros %>"
width = "<%= c_ancho_tabla %>"
selectionMode = "SINGLESELECT"
selectedRowIndex = "<%= var_selectedindex %>"
table = "<%= T_TABLA %>" >
</htmlb:tableView>
Thanks very much.
I changed your code for my program in:
data: selected_ind TYPE INT4_TABLE.
TV ?= CL_HTMLB_MANAGER=>GET_DATA( REQUEST = REQUEST
NAME = 'tableView' ID = 'myTable' ).
Marcos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Look at the changes..
<htmlb:tableView id = "myTable"
width = "<%= c_ancho_tabla %>"
design = "ALTERNATING"
visibleRowCount = "<%= c_ver_registros %>"
fillUpEmptyRows = "X"
selectedRowIndex = "<%= var_selectedindex %>" Declare var_selectedindex as Page attribute
onRowSelection = "onRowSelection"
selectionMode = "SINGLESELECT"
sort = "server"
table = "<%= T_TABLA %>" />
Raja T
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you need to declare it as int .I think that is sufficient.
<b>selected_ind type i. </b>
and get the selected value as Raja told:
IF TV IS NOT INITIAL.
TABLE_EVENT = TV->DATA.
CLEAR SELECTED_IND.
SELECTED_IND = TABLE_EVENT-><b>SELECTEDROWINDEX.</b>
ENDIF.
regards,
Bhanu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It not works
The line
onRowSelection = "onRowSelection"
does that can't be posible select the row.
And... I think that the problem is the associated type of var_selectedindex in the pages attributes.
What must be this type?
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for reply.
but I have got problems with the declarations.
If I active the code, sap display this error:
"Field HTMLB_EVENT" is unknow. It is neither in one of the specified tables nor defined by a "DATA" stament. "Data stament".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
here you go..
Did u try this code"
selected_ind TYPE INT4_TABLE
DATA: TV TYPE REF TO CL_HTMLB_TABLEVIEW,
EVENT TYPE REF TO CL_HTMLB_EVENT,
TABLE_EVENT TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.
FIELD-SYMBOLS <I> LIKE LINE OF SELECTED_IND.
TV ?= CL_HTMLB_MANAGER=>GET_DATA( REQUEST = REQUEST
NAME = 'tableView'
ID = 'list' ).
IF TV IS NOT INITIAL.
TABLE_EVENT = TV->DATA.
CLEAR SELECTED_IND.
SELECTED_IND = TABLE_EVENT->PREVSELECTEDROWINDEXTABLE.
ENDIF.
Raja T
hi Marcos,
While calling the Tableview in the layout get the selected row index in the attribute <b>selectedRowIndex = "<%= var_selectedindex %>"</b> { where var_selectedindex should be defined as a pageattribute} the tableview definition should be like this..
<htmlb:tableView id = "myTableView"
visibleRowCount = "<%= c_ver_registros %>"
width = "<%= c_ancho_tabla %>"
selectionMode = "SINGLESELECT"
<b>selectedRowIndex = "<%= var_selectedindex %>"</b>
table = "<%= T_TABLA %>" >
</htmlb:tableView>
And in the <b>inputprocessing</b> ,
Try this code..
IF htmlb_event IS NOT INITIAL AND htmlb_event->if_htmlb_data~event_name = 'tableView' AND
( htmlb_event->if_htmlb_data~event_type = 'cellClick' OR
htmlb_event->if_htmlb_data~event_type = 'rowSelection' OR
htmlb_event->if_htmlb_data~event_type = 'navigate' ) .
DATA tableview_event TYPE REF TO cl_htmlb_event_tableview.
tableview_event ?= htmlb_event.
IF lr_tableview_event->selectedrowindex IS NOT INITIAL .
var_selectedindex = tableview_event->selectedrowindex.
ENDIF.
ENDIF.
regards,
Bhanu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.