I didn't know what to do, so I test with the 0th entry. I know that it is not the solution.
In your answer, columnIndex is my "i" I guess? I can't get it, it must be "final".
I try to do that, but it doesn't work too:
i=0;
while(i<table.getColumnCount()){
final Column<List<String>, ?> column= table.getColumn(i);
columnSortHandler.setComparator(column,new Comparator<List<String>>() {
public int compare(List<String> o1,List<String> o2) {
if (o1 == o2) {
return 0;
}
if (o1 != null) {
return (o2 != null) ? o1.get(table.getColumnIndex(column)).compareTo(o2.get(table.getColumnIndex(column))) : 1;
}
return -1;
}
});
i=i+1;
}
Le mercredi 24 avril 2013 16:24:36 UTC-4, Jens a écrit :
Why do you always compare the 0th entry? Shouldn't it match the column the comparator is responsible for, e.g. o1.get(columnIndex).compareTo(o2.get(columnIndex))? -- J.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment