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

How to swap positions of drop down box values

HI,

I hae a drop down box filled with values from my database..

now i need to swap positions in the order of the values in drop down box (ie) like i neeed my 3rd element in the drop down should be first in the list ..

How can i swap positions in drop down box..

Kindly help..

Thanx,

Arjun.G

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 10:36 AM

    If you are using DropDownByIndex, just swap the corresponding node elements in the context node (say it's named "Items"):

    wdContext.nodeItems().swapElements(0, 2);

    Armin

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 07:22 AM

    Hi,

    Create a comparator of your own and sort the node using that

    wdContext.nodeTest().sortElements(Comparator arg)

    Regards

    Ayyapparaj

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Table is bounded to two nodes,

      node 1: (for general text view UI elements in the table)

      attributes:

      groupid

      group name

      cardinality:0-n

      selection:1-1

      node 2:(for drop down UI element)

      attributes:

      categoryid

      cardinality:0-n

      selection:1-1

      Thanx.

      Arjun.G

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 06:47 AM

    You can use setLeadSelection() for setting the first value of dropdown, i.e., setLeadSelection of the node bound to your dropdown.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 07:19 AM

    If you want to swap the values do it in the back end system making use of the value on which you want to sort.As soon as the values are displayed sorted as per your requirement in ascending or descending.

    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.