1 Reply Latest reply on Apr 12, 2010 3:14 AM by Wolfgang Schwaiger

    <rich:dataTable> Sorting Special Characters

    Wolfgang Schwaiger Newbie

      Hello Everybody

       

      I have a kind of special problem it seems to me, because I can not find anything about it on the community or in the web. I use a <rich:dataTable> to display a search result over multiple pages using a datascroller. The table is used in different countries with different encodings for the chars. This all works fine for us. But when it comes to sorting colums RichFaces kind of gets stuck, because it sorts the entries with special chars to the end.

       

      As an example in Hungary we have A and Á. When I sort the column the Ás are behind Z. Is there a kind of property to set or do I have to do it correctly on the serverside? The locale is correctly set in the environment, btw.

       

      Code Snippet:

           <rich:dataTable value="#{ToDoListViewController.todoItems}"
                      var="todo" width="100%" columnClasses="center"
                      rows="15" id="aufgabenUebersicht" rowClasses="list1, list2"
                      headerClass="list" style="line-height: 16px;">
                  <rich:column sortBy="#{todo.kundenName}"
                          sortOrder="#{ToDoListViewController.kundeSortOrder}">
                      <f:facet name="header">
                          <h:outputText value="#{msg.kunde}" />
                      </f:facet>
                      <h:outputLink value="#{request.contextPath}/screen/KUND401">
                          <f:param id="viewId" name="_view" value="KundSuche" />
                          <f:param id="actionId" name="_action" value="select" />
                          <f:param id="kundnrId" name="_kundnr" value="#{todo.kundenNr}" />
                          <h:outputText value="#{todo.kundenName}" />
                      </h:outputLink>
                  </rich:column>
                  <rich:column>
                      <authz:authorize ifAllGranted="ROLE_KKOM">
                          <h:outputText rendered="#{todo.kundenNr ne 0}">   
                              <adap:commdataIcon customerId="#{todo.kundenNr}" customerName="#{todo.kundenName}" />
                          </h:outputText>
                      </authz:authorize>
                  </rich:column>
                  <rich:column sortBy="#{todo.location}"
                          sortOrder="#{ToDoListViewController.locationSortOrder}">
                      <f:facet name="header">
                          <h:outputText value="#{msg.ort}" />
                      </f:facet>
                      <h:outputText value="#{todo.location}" />
                  </rich:column>
                  <rich:column>
                      <f:facet name="header">
                          <h:outputText value="#{msg.produkt}" />
                      </f:facet>               
                      <h:outputLink id="linkToProductdetail" value="#{request.contextPath}/screen/KUND220?_view=ProdListView&amp;_action=SELECT&amp;sparte=#{todo.sparte}&amp;prodnr=#{todo.produktnr}&amp;koa=">
                              <h:outputText value="#{todo.produktnrString}" />
                      </h:outputLink>
                  </rich:column>
                  <rich:column sortBy="#{todo.subject}"
                          sortOrder="#{ToDoListViewController.subjectSortOrder}">
                      <f:facet name="header">
                          <h:outputText value="#{msg.thema}" />
                      </f:facet>
                      <h:outputLink value="#{request.contextPath}/screen/AufgabenEdit">
                          <f:param id="idId" name="id" value="#{todo.ID}" />
                          <f:param id="ansichtId" name="ansicht" value="" />
                          <f:param id="currentPageId" name="currentPage" value="" />
                          <f:param id="pageSizeId" name="pageSize" value="" />
                          <f:param id="idId" name="id" value="#{todo.ID}" />
                          <h:outputText value="#{todo.subject}" />
                      </h:outputLink>
                  </rich:column>
                  <rich:column sortBy="#{todo.erstDat}"
                          sortOrder="#{ToDoListViewController.erstDatSortOrder}">
                      <f:facet name="header">
                          <h:outputText value="#{msg.erstam}" />
                      </f:facet>
                      <h:outputText value="#{todo.erstDatString}" />
                  </rich:column>
                  <rich:column sortBy="#{todo.endeDatum}"
                          sortOrder="#{ToDoListViewController.endeDatSortOrder}">
                      <f:facet name="header">
                          <h:outputText value="#{msg.faelligam}" />
                      </f:facet>
                      <h:outputText value="#{todo.endeDatumString}" />
                  </rich:column>
                  <rich:column sortBy="#{todo.state}"
                          sortOrder="#{ToDoListViewController.statusSortOrder}">
                      <f:facet name="header">
                          <h:outputText value="#{msg.status}" />
                      </f:facet>
                      <h:outputText value="#{msg.erfolglosClosed}" rendered="#{todo.state==0}" />
                      <h:outputText value="#{msg.erfolglosClosed}" rendered="#{todo.state==9}" />
                      <h:outputText value="#{msg.erfolglosClosed}" rendered="#{todo.state==10}" />
                      <h:outputText value="#{msg.inArbeit}" rendered="#{todo.state==20}" />
                      <h:outputText value="#{msg.neu}" rendered="#{todo.state==30}" />
                  </rich:column>
                  <rich:column sortBy="#{todo.statusDat}"
                          sortOrder="#{ToDoListViewController.statusDatSortOrder}">
                      <f:facet name="header">
                          <h:outputText value="#{msg.statusam}" />
                      </f:facet>
                      <h:outputText value="#{todo.statusDatString}" />
                  </rich:column>
                  <rich:column sortBy="#{todo.KZeigen}"
                          sortOrder="#{ToDoListViewController.kzEigenSortOrder}">
                      <f:facet name="header">
                          <h:outputText value="#{msg.u}" />
                      </f:facet>
                      <h:outputText rendered="#{todo.KZeigen=='E'}" value="#{msg.kzeigen_E}" />
                      <h:outputText rendered="#{todo.KZeigen=='Z'}" value="#{msg.kzeigen_Z}" />
                      <h:outputText rendered="#{todo.KZeigen=='S'}" value="#{msg.kzeigen_E}" />
                  </rich:column>
                  <f:facet name="footer">
                      <rich:datascroller align="right" for="aufgabenUebersicht" renderIfSinglePage="false" maxPages="5">
                          <f:facet name="first"><h:graphicImage url="/img/arrow-first.gif" /></f:facet>
                          <f:facet name="last"><h:graphicImage url="/img/arrow-last.gif" /></f:facet>
                          <f:facet name="previous"><h:graphicImage url="/img/arrow-previous.gif" /></f:facet>
                          <f:facet name="next"><h:graphicImage url="/img/arrow-next.gif" /></f:facet>
                          <f:facet name="fastforward"><h:graphicImage url="/img/arrow-ff.gif" /></f:facet>
                          <f:facet name="fastrewind"><h:graphicImage url="/img/arrow-fr.gif" /></f:facet>
                      </rich:datascroller>
                  </f:facet>
              </rich:dataTable>

       

      Thank you for your help.

       

      Kind regards,

      Wolfgang