}
protected void sort(final String column, final boolean ascending) {
Comparator comparator = new Comparator() {
public int compare(Object o1, Object o2) {
CasesVO c1 = (CasesVO) o1;
CasesVO c2 = (CasesVO) o2;
if (column == null) {
return 0;
}
if (column.equals("caseNumber")) {
return ascending
? c1.getCaseNumber().compareTo(c2.getCaseNumber())
: c2.getCaseNumber().compareTo(c1.getCaseNumber());
/* } else if (column.equals("customerName")) {
return ascending
? c1.getCustAccountVO().getCustomerName1().compareTo(c2.getCustAccountVO().getCustomerName1())
: c2.getCustAccountVO().getCustomerName1().compareTo(c1.getCustAccountVO().getCustomerName1()); */
} else if (column.equals("subject")) {
return ascending
? c1.getSubject().compareTo(c2.getSubject())
: c2.getSubject().compareTo(c1.getSubject());
} else if (column.equals("status")) {
return ascending
? c1.getStatus().compareTo(c2.getStatus())
: c2.getStatus().compareTo(c1.getStatus());
} else if (column.equals("priority")) {
return ascending
? c1.getPriority().compareTo(c2.getPriority())
: c2.getPriority().compareTo(c1.getPriority());
} else {
return 0;
}
}
};