on 01-29-2008 6:22 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This is because all the table row point to the same element of the drop down.
If you look at table concept wise
each row inside the table is an element of the node which is bound to it.
So In your case as you have a different context for the dropdown, which is not getting created for each row.
Regards
Ayyapparaj
Make "Items" a non-singleton child node of "Rows". Fill "Items" with code like
/* To fill drop-down list in row at index i: */
IRowsElement row = wdContext.nodeRows().getRowsElementAt(i);
for (int j = 0; j < num_items_in_row_i; ++j)
{
IItemsElement item = row.nodeItems().createItemsElement();
item.setText("Item #" + j + " in row #" + i);
row.nodeItems().addElement(item);
}
Replace "Items" and "Rows" by the names of your context nodes.
Armin
Hi,
Create a comparator of your own and sort the node using that
wdContext.nodeTest().sortElements(Comparator arg)
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use setLeadSelection() for setting the first value of dropdown, i.e., setLeadSelection of the node bound to your dropdown.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.