on 05-11-2007 12:08 PM
Hi,
Can anybody help with the following question. I need to dynamically sort a listbox? Anybody any ideas?
Cheers,
Onno
Hi,
try the below code
wdContext.nodeMainNode().sortElements( new Comparator(){
public int compare( Object o1, Object o2 ){
int i = 0;
IPrivateRFCAppView.IMainNodeElement e1 = ((IPrivateRFCAppView.IMainNodeElement)o1);
IPrivateRFCAppView.IMainNodeElement e2 = ((IPrivateRFCAppView.IMainNodeElement)o2);
i = e1.getVar1().compareToIgnoreCase( e2.getVar1() );
return i;
}//compare
});
please check the below thread
AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great thanks for the quick. Replies.
Cheers,
Onno
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Onno,
Using the class IModifiableSimpleValueSet you have a standard method to sort the dropdow content.
IModifiableSimpleValueSet valueSet = wdThis.wdGet<Component Controller>().wdGetContext().getContext().getModifiableTypeOf("node.attribute").getSVServices().getModifiableSimpleValueSet();
<b>valueSet.sort(boolean sortByKey, boolean up, boolean ignoreCase);</b>
I give you two examples:
First: Sort by text value:
<b>valueSet.sort(false, true, true);</b>
Second: Sort by Key:
<b>valueSet.sort(true, true, true);</b>
Regards,
Luciano
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.