Skip to Content
0
Former Member
Nov 14, 2006 at 07:21 PM

Any way to sort elements in a ResultSet

20 Views

Is there any way to sort the elements in a ResultSet? I have code that accesses the UME users and displays their name and email in an EVS search help. I'd like to sort the list by name if possible. In case it is helpful here is the code I am using in the WDDoInit method of the view:

IUserFactory ufact = UMFactory.getUserFactory();

IUserSearchFilter isf;

try {

isf = ufact.getUserSearchFilter();

isf.setUniqueName("*", ISearchAttribute.LIKE_OPERATOR,false);

isf.setCity("Tewksbury", ISearchAttribute.EQUALS_OPERATOR,false);

ISearchResult sr = ufact.searchUsers(isf);

String strtest = "";

String strnamen = "";

String stremail = "";

String attributeName =

IPrivateGenReceiptsMainView.IReceiptElement.ADDRESSED_TO;

IWDAttributeInfo attributeInfo =

wdThis.wdGetContext().nodeReceipt().getNodeInfo().getAttribute(attributeName);

ISimpleTypeModifiable AddressedType = attributeInfo.getModifiableSimpleType();

AddressedType.setFieldLabel("AddressedTo");

IModifiableSimpleValueSet valueSet =

AddressedType.getSVServices().getModifiableSimpleValueSet();

while (sr.hasNext()) {

strtest = sr.next().toString();

IUser user = UMFactory.getUserFactory().getUser(strtest);

strnamen = user.getDisplayName();

stremail = user.getEmail();

valueSet.put(user.getDisplayName(),stremail);

}

} catch (UMException e) {

e.printStackTrace();

}