Issue Details (XML | Word | Printable)

Key: DISPL-306
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Reporter: Tim Fennell
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DisplayTag

Ability to set default comparator for sorting String columns

Created: 09/Mar/06 04:23 PM   Updated: 14/Aug/07 04:31 PM   Resolved: 24/Nov/06 02:54 PM
Return to search
Component/s: Paging/Sorting
Affects Version/s: None
Fix Version/s: 1.4

Time Tracking:
Not Specified


 Description  « Hide
The ability to use custom comparators for sorting in DT1.1 is a big step forward. However, for sites with lots of tables it would be really nice to be able to specify a default comparator other than the DefaultComparator included in display tag. This way you could define the comparator class to be used once, and not have to repeat it on every single table and column where it was needed.

I should state that ideally the setting would be displaytag.properties and would only set the default for sorting Strings! The fact that DisplayTag correctly sorts numbers (and other rich types?) correctly in DT1.1 is great, and I wouldn't want to have to reimplement the type-detection code etc.

The reason I'd like to be able to do this is to be able to sort strings in a more human-orienteded manner. For example Mac OS X will sort the values "foo1", "foo2" and "foo10" in the order given, NOT "foo1", "foo10", "foo2" which is correct if you are doing a strict alpha-numeric character sort. Of course if the DefaultComparator were enhanced to include such logic then that would meet my needs pretty well too! For a longer discussion on sorting of Strings and an example of the comparator I'd like to use check out:
    http://jroller.com/page/tfenne?entry=humanestringcomparator_sorting_strings_for_people

fabrizio giustina made changes - 19/Mar/06 03:10 PM
Field Original Value New Value
Fix Version/s 1.2 [ 12369 ]
andy pruitt added a comment - 24/Nov/06 02:54 PM
Fixed in head; added new property to control the default comparator

andy pruitt made changes - 24/Nov/06 02:54 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
fabrizio giustina made changes - 14/Aug/07 04:31 PM
Status Resolved [ 5 ] Closed [ 6 ]