cancel
Showing results for 
Search instead for 
Did you mean: 

lead selection on button click in table control

0 Kudos

Good day friends

I have a table control with lead selection. One of the columns in each row contains a button "Upload". The problem I have is lead selection may be set to row 1 but a user can click on the upload button in row3. So the user thinks they have clicked on the upload botton for row 3 but web dynpro thinks they have clicked on the upload button for row 1.

Does anyone know of a way of setting the lead selection to the row the user has clicked (i.e. row 3)? None of the events available for the table control seem to be able to achieve this.

Another possible solution I guess would be to get the index of the row where the user has clicked and I could at least compare this to the lead selection index and output a message to the user.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi stuart,

Initially lead selection is set to the first row right?

when you click the button on third row,you set the third row as lead selection,that is once you click on third row button,lead selection of first row should be chaged to third row,to do so...

Try the following code on the action of the button:

DATA lo_nd_node_tab1 TYPE REF TO if_wd_context_node.

DATA lo_el_node_tab1 TYPE REF TO if_wd_context_element.

DATA ls_node_tab1 TYPE wd_this->element_node_tab1.

DATA lv_index TYPE i.

lo_nd_node_tab1 = wd_context->get_child_node( name = wd_this->wdctx_node_tab1 ).

lo_el_node_tab1 = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).

lv_index = lo_el_node_tab1->get_index( ).

lo_nd_node_tab1->set_lead_selection_index( lv_index ).

I hope this helps you,

Thanks,

Krishna

Answers (1)

Answers (1)

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

You can use Table popin and supply function to achieve it.

Declare a node within which add another node which contains buttons.

Create a table popin for the internal node.

Check this link for using supply function.

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/600729d2-d2c4-2d10-7ab5-d3f720908368

Check this link for table popin.

https://cw.sdn.sap.com/cw/docs/DOC-13104