cancel
Showing results for 
Search instead for 
Did you mean: 

2 tableView's keepSelectedRow

former_member184313
Participant
0 Kudos

Hey Guys

I've got a special problem with two tableViews on the same page:

If I select a row of the first tableView, the second tableView is getting processed on the screen and the selected row of the first tableView apears marked. Evereything ok by now!

If I now select a row in the second tableView, the marked row of the first tableView apears unmarked again.

Any ideas, how to keep the row of the first tableView marked?

thanks a lot

danny

my coding:

<%-- Projektliste --%>

<htmlb:form>

<htmlb:tableView id = "tv_proj"

headerText = "Projekte"

headerVisible = "true"

design = "standard"

visibleRowCount = "8"

fillUpEmptyRows = "true"

footerVisible = "false"

selectionMode = "singleselect"

onRowSelection = "Projekte"

keepSelectedRow = "true"

table = "<%= application->rpm_project_list %>" >

<htmlb:tableViewColumns>

<htmlb:tableViewColumn columnName = "EXTERNAL_ID"

wrapping = "true"

width = "100"

title = "Projekt ID" >

</htmlb:tableViewColumn>

<htmlb:tableViewColumn columnName = "PROJ_DESCRIPTION"

wrapping = "true"

width = "100"

title = "Projektbeschreibung" >

</htmlb:tableViewColumn>

</htmlb:tableViewColumns>

</htmlb:tableView>

</htmlb:form>

</td>

<%

if not application->rpm_proj_bewertung[] is initial.

%>

<td valign="top">

<%-- Bewertungsliste --%>

<htmlb:form>

<htmlb:tableView id = "tv_bewert"

headerText = "Bewertung"

headerVisible = "true"

design = "standard"

visibleRowCount = "8"

fillUpEmptyRows = "true"

footerVisible = "false"

selectionMode = "singleselect"

onRowSelection = "Bewertung"

keepSelectedRow = "true"

table = "<%= application->rpm_proj_bewertung %>" >

<htmlb:tableViewColumns>

<htmlb:tableViewColumn columnName = "ZRPM_SFDAT"

wrapping = "true"

width = "100"

title = "Datum" >

</htmlb:tableViewColumn>

</htmlb:tableViewColumns>

</htmlb:tableView>

</htmlb:form>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

can u put your code for processing here that is what you are doing on selction of row in second tableview. so it will become more clear what exactly you are doing

Regards

Naresh

former_member184313
Participant
0 Kudos

Hy Naresh,

thanks for your answer! If I take out the event handling for second tableView, it has no effect.

Btw this is a statefull application. Here's my event processing:

DATA: event TYPE REF TO cl_htmlb_event,

tab_view TYPE REF TO cl_htmlb_tableview,

tab_view_data TYPE REF TO cl_htmlb_event_tableview.

event = cl_htmlb_manager=>get_event( runtime->server->request ).

IF event_id = cl_htmlb_manager=>event_id.

tab_view ?= cl_htmlb_manager=>get_data(

request = runtime->server->request

name = 'tableView'

id = 'tv_proj' ).

IF NOT tab_view IS INITIAL.

tab_view_data = tab_view->data.

IF NOT tab_view_data->selectedrowindex IS INITIAL.

READ TABLE application->rpm_project_list

INDEX tab_view_data->selectedrowindex

INTO ls_rpm_proj_list.

CALL METHOD application->on_proj_select

EXPORTING

i_act_proj = ls_rpm_proj_list-external_id.

ENDIF.

ENDIF.

tab_view ?= cl_htmlb_manager=>get_data(

request = runtime->server->request

name = 'tableView'

id = 'tv_bewert' ).

IF NOT tab_view IS INITIAL.

tab_view_data = tab_view->data.

IF NOT tab_view_data->selectedrowindex IS INITIAL.

READ TABLE application->rpm_proj_bewertung

INDEX tab_view_data->selectedrowindex

INTO ls_rpm_proj_bewert.

CALL METHOD application->on_bewert_select

EXPORTING

i_act_proj = ls_rpm_proj_bewert-guid

i_bewert_dat = ls_rpm_proj_bewert-zrpm_sfdat.

ENDIF.

ENDIF.

Thanks a lot.

Danny

maximilian_schaufler
Active Contributor
0 Kudos

Hi Daniel,

I think the problem is that you are using the htmlb:form element twice in your page - each tableView in its own form. Therefore, on submitting any action in the second tableview, no information about the first is getting submitted to the server at all.

I really recommend to only use one form element, that is wrapped around all other elements within your page content.

Cheers,

Max

former_member184313
Participant
0 Kudos

Hey Max!

You're absolutely right. Problem solved!

Thank you very much!

Regards

Danny

maximilian_schaufler
Active Contributor
0 Kudos

Dont't forget to mark the question solved (<a href="https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm#lostme">https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm#lostme</a>) for future search in the forum.

Max

Answers (0)