on 05-08-2007 11:37 AM
Hi,
I have a TableView with selection mode MULTISELECT.
<htmlb:tableView id = "TVTABLE"
selectionMode = "MULTISELECT"
visibleRowCount = "20"
sort = "SERVER"
filter = "SERVER"
tabIndexCell = "TRUE"
table = "//mr_model/mt_table"
visibleFirstRow = "<%= controller->mv_table_first_row %>"
iterator = "<%= mr_iterator %>" />
I select some rows and make a server roundtrip from this page back to the same page. The row selection is retained even after the roundtrip.
Why is this so? If this is the standard behaviour, then is there any way to refresh the selection?
Pls note that I'm not using the selectedRowIndexTable or selectedRowKeyTable attributes.
Regards,
Pradeep
Hi Pradeep,
Here is the code...!!
cl_htmlb_manager=>check_tableview_all_rows( rowcount = n
request = request
id = '<tableview id>'
keytable = keytable "Table containing the key values of your itab
check = '' ). "If its 'X' all items will be selected and ' ' will uncheck all items.
<i>Do reward each useful answer..!</i>
Thanks,
Tatvagna.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Where have you used this code....
Is your application statefull ?? If so what you can do is that you can set a FLAG, and post this in the onCreate event by doing SWITCH-CASE on the FLAG.
It should work....works for me though...!!
If it is till not working, post your code here and let us have a look.
<i>Do reward each useful answer..!</i>
Thanks,
Tatvagna.
Message was edited by:
Tatvagna Shah
If the above mentioned solutioin doesn't work use this code. for sure it will work
In the defination you should have
<htmlb:tableView id = "TVTABLE"
selectionMode = "MULTISELECT"
visibleRowCount = "20"
sort = "SERVER"
keyColumn = "PERNR"
filter = "SERVER"
selectedRowKeyTable = "<%=key_tab%>"
tabIndexCell = "TRUE"
table = "<%=lt_01%>" />
Key Column and Selected Row Table
AND
in the handle event you should play with
DATA: lr_event TYPE REF TO if_htmlb_data,
lr_ana_tv TYPE REF TO cl_htmlb_tableview,
lr_ana_tv_data TYPE REF TO cl_htmlb_event_tableview.
* 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.
lr_ana_tv ?= cl_htmlb_manager=>get_data(
request = runtime->server->request
name = 'tableView'
id = 'TVTABLE' ).
lr_ana_tv_data = lr_ana_tv->data.
* you can refresh the selected row table how so ever you want...
refresh lr_ana_tv->data->PREVSELECTEDROWINDEXTABLE[].
refresh lr_ana_tv->data->PREVSELECTEDROWKEYTABLE[].
hope this helps.
Amandeep
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.