on 12-13-2010 8:53 AM
Hi,
My requirement is to display dropdown by key data with sorting getting this data from XML in KM.
Tell me different possibilities to sort the data.
Regards,
surya.
self
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use DropDownByIndex instead of DropDownByKey
Create a node with a attribute for eg. Colors node with Color attribute and add the values in the elements of the node, Bind attribute to DropDownByIndex UI.
Create a custom comparator class like below
import java.util.Comparator;
import com.sap.tc.webdynpro.progmodel.api.IWDNodeElement;
import com.sap.tc.webdynpro.progmodel.repository.enums.WDComponentLifecycleEnumInfo;
public class CustomComparator implements Comparator {
String attribute;
public CustomComparator(String attrib) {
this.attribute = attrib;
}
public int compare(Object o1, Object o2) {
try
{
IWDNodeElement units1 = (IWDNodeElement) o1;
IWDNodeElement units2 = (IWDNodeElement) o2;
return units1.getAttributeAsText(attribute).compareTo(units2.getAttributeAsText(attribute));
}
catch (Exception e)
{
e.printStackTrace();
}
//arbitrary order
return 1;
}
}
Once you read values in the Colors node, call the sortElements method of the node as below to sort the elements of the node
wdContext.nodeColors().sortElements(new CustomComparator("Color"));
Regards,
Amol
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Surya,
Try to use DropDOwnByINDex in the table ui elemnt and also check this article
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c03227f9-e48f-2c10-4bad-8ebdec704f3d
hope it helps.
Regards,
Sen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
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.