cancel
Showing results for 
Search instead for 
Did you mean: 

How to automatically select a row in a tableview?

wolfgang_haerle
Explorer
0 Kudos

Hi,

after adding a row to my tableview based table (OnInputProcessing) I'd like to have this row show up automatically (pre-)selected. Anybody an idea of how to do this?

Thanks a bunch!

Wolfgang

Accepted Solutions (0)

Answers (2)

Answers (2)

wolfgang_haerle
Explorer
0 Kudos

Shailaja,

thanks for your answer. Unfortunately I tried that already and it is not working.

I got it to finally to work by setting the attribute selectedRowIndex of the tableview in the 'Layout'!

Wolfgang

Former Member
0 Kudos

hi Wolfgang,

Try like this:

data: tv_data TYPE REF TO cl_htmlb_event_tableview,

tv TYPE REF TO cl_htmlb_tableview.

tv ?= cl_htmlb_manager=>get_data( request = runtime->server->request

name = 'tableView'

id = 'myTableView1' ).

IF tv IS NOT INITIAL.

tv_data = tv->data.

//**** check here if your table is not empty***//

tv_data->SelectedRowIndex = tv_data->PREVSELECTEDROWINDEX.

endif.

Regards,

Shailaja