Ability to set default comparator for sorting String columns
------------------------------------------------------------

         Key: DISPL-306
         URL: http://jira.codehaus.org/browse/DISPL-306
     Project: DisplayTag
        Type: Improvement

  Components: Paging/Sorting  
    Reporter: Tim Fennell


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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
displaytag-devel mailing list
displaytag-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to