Skip to Content
author's profile photo Former Member
Former Member

difference between dropdownbykey and dropdownbyindex

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 09:02 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 09:13 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 09:21 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.