|
Hi Gretta! Thanks for your reply. Please see my comments in-line below.... Yes. My Sort method looks like this, but the strange thing is that it's not even being called until I remove the "#" that is being tacked on to the URL in in the browser after I click a column name. Then it appears the problem is that the setSortColumn() method is not being called. (I have the SortColumn equal to the class where the property and getter/setters are for that property so I don't know why this is still happening.) protected void sort(final String column, final boolean ascending) { Comparator comparator = new Comparator() { public int compare(Object o1, Object o2) { PersonDataItem c1 = (PersonDataItem)o1; PersonDataItem c2 = (PersonDataItem)o2; if (column == null) { return 0; } if (column.equals("personName")) { return ascending ? c1.getPersonName().compareTo(c2.getPersonName) : c2.getPersonName.compareTo(c1.getPersonName()); } else return 0; } }; Collections.sort(_persons, comparator); } I have most of the code you're referring to also, but the main problem is that when I click the column, the setColumnName method in the bean doesn't fire. I'm also wondering about the value part of the table definition. It seems to be OK, but I'm running out of things to look at. Mine is: value ="#{TD.getPersons}" And, the corresponding getPersons() method looks like this (and this one is being called): public List getPersons() { try { this.loadFromDB(); // loads the ArrayList from Database. } catch (SQLException e) { } sort(getSortColumn(), isAscending()); _persons= arrayListData; return _persons; } Strange, huh? Mike |
- Re: Getting sorting to work in data table -- header click... Mike
- Re: Getting sorting to work in data table -- header ... gramani
- Data Table Sorting still not working Mike
- RE: Data Table Sorting still not working Tom Butler
- Re: Data Table Sorting still not working Mike
- RE: Data Table Sorting still not wo... Tom Butler
- Re: Data Table Sorting still no... Mike
- HURRAY!!! SORTING IS WORKING!!!... Mike
- Re: HURRAY!!! SORTING IS WO... Legolas Woodland
- Re: HURRAY!!! SORTING IS WO... Mike
- Re: HURRAY!!! SORTING IS WO... Legolas Woodland

