cancel
Showing results for 
Search instead for 
Did you mean: 

Linking multiple dropdowns

IanStubbings
Active Participant
0 Kudos

Hi

What's the best way to link several dropdown by index's? I wish to select a value on one dropdown and then display the same result on several other ones.

Cheers

Ian

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member515618
Active Participant
0 Kudos

Hi Ian,

Could you please be a bit more clear with the requirement.

Regards,

Sravan

IanStubbings
Active Participant
0 Kudos

Hi Sravan

Basically I have 4 dropdowns that I wish to keep synchonised. When I select any one of them, the rest should then change to the value I have just set.

You may wonder why I need 4? Me too, but that is what has been asked for.

Cheers

Ian

former_member515618
Active Participant
0 Kudos

Hi Ian,

When user selects some thing from the dorpdown then an event 'OnSelect' is triggered.

In this event handler, Default the other dropdowns whith the value selected.

Hope this is what you want.

Regards,

Sravan Varagani

Former Member
0 Kudos

Hi,

If you bind all 4 of them to the same node,

your requirements are met or does it require more functionality?

Like the default should be the same but possible to maintain 3 of them?

grtz,

Koen

IanStubbings
Active Participant
0 Kudos

THanks for your replies, guys.

I am coding within the onSelect method currently but so far no success. To things harder, the dropdowns are columns attached to a tree type master column. The rows are the detail level of an entry hence the multiple occurrences. I cannot use the header level to display the dropdown as 'rating' applies to the detail level not the header level although in this instance they must all be set to the same value.

I am trying to get hold of the current value and then get references to the others to then set the values. It seems like a lot of effort to go to so I was wondering if there was a better way.

Cheers

Ian

Former Member
0 Kudos

Hi,

you can capture the selected element in the onSelect (import parameter) and the index.

if you now loop over the elements in the detail node detail_node->get_elements( ).

there you get the child node with the dropdown values, you use SET_LEAD_SELECTION_INDEX with the index.

brief:

lt_elements = node details->get_elements( ).

loop lt_elements assigning <fs_elements>.

lo_dropdownlist = <fs_elements>->get_child_node( name..).

lo_dropdownlist->set_lead_selection_index( index ).

endloop.

grtz,

Koen

IanStubbings
Active Participant
0 Kudos

Right sorted.

My mistake was thinking that the context_element import parameter related to the dropdown element. It actually held the reference to the higher element for the tree structure. Once I corrected my code, everything fell into place.

I used a method similar to that suggested by Koen but set the values using the static attrbutes rather than the lead selection.

Many thanks for you input.

Cheers

Ian