Strings should be trimmed before sort
-------------------------------------

         Key: DISPL-259
         URL: http://jira.codehaus.org/browse/DISPL-259
     Project: DisplayTag
        Type: Improvement
  Components: Paging/Sorting  
    Versions: 1.0    
    Priority: Minor


When there is no property and no sortProperty on a column, the rows are sorted 
using the raw text of the column. The text should be trimmed fefore sorting, 
else the number of whitespaces before the actual text has an impact on the sort.
For example, if I have a column like this:

  <display:column titleKey="entreprises.type"
                  sortable="true">
    <c:choose>
      <c:when test="${entreprise.type == 1}">
        SARL
      </c:when>
      <c:when test="${entreprise.type == 2}">
        Société
      </c:when>
      <c:otherwise>
        SA
      </c:otherwise>
    </c:choose>
  </display:column>

The first rows are the one with SA, then the ones with Société and finally the 
ones with SARL, which isn't alphabetically correct. This is just because the 
number of white spaces is not the same depending on the enterprise type.

-- 
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 the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
displaytag-devel mailing list
displaytag-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to