cancel
Showing results for 
Search instead for 
Did you mean: 

difference between dropdownbykey and dropdownbyindex

Former Member
0 Kudos

Hi Colleagues,

I am not able to understand the basic difference between dropdown by key and index.. please tell me , also let me know how to decide what we should use..

Cheers!!!

Vivek

Accepted Solutions (1)

Accepted Solutions (1)

former_member196517
Contributor
0 Kudos

A DropDownByIndex UI element provides the user with a dropdown list box. You cannot select more than one entry from the selection list. The UI element consists of a text field, a button, and a selection list. Any list entry already selected is displayed in the text field. When you select the pushbutton, a list with all possible values is displayed.

A DropDownByKey UI element provides the user with a selection list from which he or she can select no more than one entry. The UI element consists of a text field, a button, and a selection list. Any list entry already selected is displayed in the text field. When you select the pushbutton, a list with all possible values is displayed.

The dropdown list box UI elements do not differ from each other when displayed on the screen. However, the data binding model for the DropDownByKey UI element has a completely different concept

Message was edited by:

Anuj Goyal

Answers (2)

Answers (2)

Former Member
0 Kudos

For a drop down by index, the values are populated from a context attribute in the node itself. You have one attribute in the node that holds the list of values and the dropdown gets populated based on that.

In a dropdown by key, the values are populated as a value set, on the context node info. So if you use this in a table, all the rows will have the same value set. Whereas in a index scenario, the list of values for each row depends on the values bound to the context attribute in that particular row.

Look into the component <b>wdr_test_events</b> that has separate views implementing both types of drop downs, that should clarify things better. Other than the case where you want different values in each row of a table, you should be able to use both the implementations and either one will work fine.

Regards

Nithya

Former Member
0 Kudos

hi Vivek,

There is no difference in the appearance of the two.However the data binding for the two differs.

This is also usually more efficient than DropDownByIndex..

If you want to create a table with dropdown lists, whereby each table row has the same values in its dropdown list, you should use DropDownByKey

If you want to create a table with dropdown lists, whereby each table row can have different values in its dropdown list, you should use DropDownByIndex.