Skip to Content
0
Apr 14, 2005 at 08:47 AM

How to sort the elements of Drop down list?

97 Views

Hello,

I create DropDownByKey element in Webdynpro. I want to sort elements in the drop down list.

In wdDoInit() method i have following code:

...........

IWDNodeInfo componentsNodeInfo = omponentsNode.getNodeInfo();

IWDAttributeInfo originalAI = componentsNodeInfo.getAttribute("original");

ISimpleTypeModifiable originalComp = originalAI.getModifiableSimpleType();

originalCompSet = originalComp.getSVServices().getModifiableSimpleValueSet();

for (int i = 0; i < compotibleComps.size(); i++) {

ISoftwareComponent component =(ISoftwareComponent) compotibleComps.get(i);

originalCompSet.put("Key_" + i, component.getDisplayname());

components.put("Key_" + i, component);

}

//sort components

originalCompSet.sort(this.getComparator());

.......

private Comparator getComparator() {

Comparator result = new Comparator() {

public int compare(Object source, Object target) {

}

};

return result;

}

An instance of which class is the "source"? How can i implement compare method?

regards, Krasimira