cancel
Showing results for 
Search instead for 
Did you mean: 

How to keep the line selection on an entry of a table UI element

Former Member
0 Kudos

Hello all,

I have a table ui element which is filed by more entries, and after clicking on an entry, i click on a button to set the actuel date in this entry, until now everything is working fine, but after changing the date, the lead selection will be set on the first entry of the table again, and not that one that have been changed.

so how can I keep the lead selction on the same entry after changing it, so that the user knows which row he changed.

thank you all

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

but after changing the date, the lead selection will be set on the first entry of the table again, and not that one that have been changed.

I wonder how this happens ?. When you select a row and edit , the lead selection is not altered automatically. Are you sure that you are not binding the table once again ?.

Normal circumstances you do not get this behavior. You get this when you have Filter/Sort , Bind new table or remove element from context etc.

Former Member
0 Kudos

no, its each time after chaning the date, the lead selction will be set on the first entry,

so how can i get the index first to set it again?

thank you all

former_member199125
Active Contributor
0 Kudos

Scafandri

try my solution, and let me know

Regards

Srinivas

Former Member
0 Kudos

Thank you a lot

problem solved

BR

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi ,

you can do this lead selection by index by method available for conext ie if_wd_context_node->set_lead_selection() .

Use importing parameter for your index

Regards

Kuldeep

Former Member
0 Kudos

Hi,

Have you checked by removing lead selection of node.

Or you can set lead_selection based on index, i mean you are changing some row get taht lead selection andset lead selection index.

Cheers,

Kris.

Former Member
0 Kudos

hello Kissnas,

would you please give an example from wihch class and interface to do this.

BR

former_member199125
Active Contributor
0 Kudos

Hi Scafandri ,

LEAD SELECTION IS A PROPERTY OF A NODE. YOU CAN CHECK AND UNCHECK THAT PROPERTY UNDER NODE PROPERTIES.

OR IF YOU WANT TO SET SELECTED ROW AS LEAD SELECTION THEN USE THE BELOW LINK IT WOULD BE HELPFUL

In onclick event of alv table,

first get the index value of selected row using r_param->get_index( ).

Then using this value set lead selection like below

lo_nd_itab->set_lead_selection_by_index ( above index value ).

Then selected row will become the leadselection.

Regards

Srinivas