on 05-15-2014 8:26 PM
Hi Experts,
I have a table with a dropdown field. How can i get the index of the row when the dropdown field is selected ?
Thanks,
Prisford Pereira
Hi Prisford,
Rama and Sankar are both correct, I just wanted to add that you may also include the standard event handler parameter, CONTEXT_ELEMENT in the signature of your event handler method as follows...
and then you may directly write..
context_element->get_index( ).
Note that the CONTEXT_ELEMENT parameter will only ever be populated if the event occurs within a Table (so a 0..n or 1..n context node). If you had a stand-alone dropdown for example (outside of a Table), the CONTEXT_ELEMENT parameter would be null in the event handler method.
Cheers,
Amy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi pereira,
To read the selected record or index. In the event handler methods, we have a parameter called
WDEVENT.
Data : lo_el_data type ref to if_wd_context_element.
lo_el_data = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
lv_index = lo_el_data->get_index( ).
Thanks & Regards,
Sankar Gelivi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prisford,
You can achieve your requirement as below
write the below code to get the current index of row
data lo_element type ref to if_wd_context_element.
data lv_curr_row_index type i.
lo_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
lv_curr_row_index = lo_element->get_index( ).
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
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.