}
protected void sort(final String column, final boolean ascending) {
Comparator comparator = new Comparator() {
public int compare(Object o1, Object o2) {
SalesOrderVO c1 = (SalesOrderVO) o1;
SalesOrderVO c2 = (SalesOrderVO) o2;
if (column == null) {
return 0;
}
if (column.equals("assignedTo")) {
return ascending
? c1.getSalesOrderNumber().compareTo(c2.getSalesOrderNumber())
: c2.getSalesOrderNumber().compareTo(c1.getSalesOrderNumber());
} else if (column.equals("beginDate")) {
return ascending
? c1.getSalesRep().compareTo(c2.getSalesRep())
: c2.getSalesRep().compareTo(c1.getSalesRep());
} else {
return 0;
}
}
};