cancel
Showing results for 
Search instead for 
Did you mean: 

UI table dropdown column index

Former Member
0 Kudos

Hi!

I have an editable UI table, which contains a Dropdown colum. The dropdown can have 3 values (A/B/C), and it's onselect event is ONSELECT_DROPDOWN.

The table has f.e 10 rows.

I would like to know in the ONSELECT_DROPDOWN event the index of the table row, where the user modified the value of the dropdown. How can I know it?

Thank you

Tamá

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

you can use the following code in the action handler....to get the index...

DATA: l_count TYPE i.

l_count = context_element->get_index( ).

thanks...

AS

Former Member
0 Kudos

It gives a dump, because I think it gives back the index of the lead selection.

DATA: l_count TYPE i.

l_count = context_element->get_index( ).

However, changing the value of a dropdown does not require to set the lead selection...

Former Member
0 Kudos

HI,

TRY THIS :

DATA: lr_element TYPE REF TO if_wd_context_element,

lv_row_number type i value 0.

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

lv_row_number = lr_element->get_index( ).

I hope it will help you.

Answers (2)

Answers (2)

Former Member
0 Kudos

It is working fine, thanx

Former Member
0 Kudos

Hi

{

It gives a dump, because I think it gives back the index of the lead selection.

DATA: l_count TYPE i.

l_count = context_element->get_index( ).

However, changing the value of a dropdown does not require to set the lead selection...

}

for your dropdown when you created the event handler...I guess you did not ceck the "check box = Transfer UI Event Parameters"

when you select this check box....WDA framework will automatically gives you "Context_Element" as an importing parameter...

In this case you will not get any dump....otherwise you need to declare a ref variable which can give you the context_element...which you already got the solution for. The dump you were getting is because you are trying to get to the context element without having any access to it....

Thanks...

AS..

Former Member
0 Kudos

Hi,

In that action handler, you will have a parameter context elemnet , it will have the value.

Regards,

Lekha.