on 07-22-2009 6:56 PM
Hi all,
I'm using the SimpleType for show all contents in a Search Help. But I have two problems. The first is that I can only use two columns for it. Can I use more than 2 columns? The secod is that I need to put a sort in this search Help. I dont know if it is possible.
See my source code below:
Private void shBusca_Pais(IWDAttributeInfo attributeInfo) {
ISimpleTypeModifiable modeloType = attributeInfo.getModifiableSimpleType();
modeloType.setFieldLabel("Pais");
IModifiableSimpleValueSet valueSet = modeloType.getSVServices().getModifiableSimpleValueSet();
for (int i =0; i < wdContext.nodeS_Paises().size(); i++){
valueSet.put(wdContext.nodeS_Paises().getS_PaisesElementAt(i).getLand1(),
wdContext.nodeS_Paises().getS_PaisesElementAt(i).getLandx());
}
}
Great,
Hi Marcelo
Use this method, and pass the node as parameter
In this example i order the element using a IWorKCentreNode Interface
private void sortElements(IWDNode node) {
node.sortElements
(
new Comparator(){
public int compare(Object x, Object y) {
String ax = ((IWorkCentreElement) x).modelObject().getDescription().getWorkCentreDescription().get$0023SimpleContent().toString().toUpperCase(); //Zdistname is the context attribute name of the sorted lement
String ay = ((IWorkCentreElement) y).modelObject().getDescription().getWorkCentreDescription().get$0023SimpleContent().toString().toUpperCase();
if (ax == null) {
return ay == null ? 0 : 1;
}
return ax.compareTo(ay);
}
}
);
}
Hope i help you
Marcos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marcelo
Sorting is available programmatically:
IModifiableSimpleValueSet.sort(boolean sortKey,boolean up,boolean ignoreCase);
IModifiableSimpleValueSet.sort(Comparator<? super T> comparator);
BR, Sergei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
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.