5 Replies Latest reply on Mar 18, 2011 11:12 AM by Nick Belaevski

    Richfaces 4: Datatable and client side sort don´t work

    Flávio Henrique Newbie

      It´s seems that DataTable client side ordering don´t work in RF 4.0 M6. The column header don´t turns into a sortable header.

       

       

       

       

       

       

       

       

       

       

       

      <?xml version="1.0" encoding="UTF-8" ?>

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml"

      xmlns:h="http://java.sun.com/jsf/html"

      xmlns:f="http://java.sun.com/jsf/core"

      xmlns:a4j="http://richfaces.org/a4j"

      xmlns:rich="http://richfaces.org/rich">

      <h:head>

      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

      <title>Insert title here</title>

      </h:head>

      <h:body>

      <h:form>

        <rich:panel>

         <f:facet name="header">

          <h:outputLabel value="Painel" />

         </f:facet>

         <rich:dataTable width="700" value="#{meuMB.pessoas}" var="pessoa"

          rows="5" noDataLabel="Não há dados" sortMode="single">

          <rich:column sortBy="#{pessoa.nome}">

           <f:facet name="header">

            <h:outputLabel value="Nome" />

           </f:facet>

           <h:outputText value="#{pessoa.nome}" />

          </rich:column>

       

          <rich:column sortBy="#{pessoa.idade}">

       

           <f:facet name="header">

            <h:outputLabel value="Idade" />

           </f:facet>

           <h:outputText value="#{pessoa.idade}" />

          </rich:column>

          <rich:column sortBy="#{pessoa.salario}">

           <f:facet name="header">

       

            <h:outputLabel value="Salario" />

       

           </f:facet>

           <h:outputText value="#{pessoa.salario}">

            <f:convertNumber maxIntegerDigits="6" maxFractionDigits="2"

             pattern="#,##0.00" type="currency" />

           </h:outputText>

          </rich:column>

       

          <f:facet name="footer">

       

           <rich:dataScroller />

          </f:facet>

         </rich:dataTable>

        </rich:panel>

      </h:form>

      </h:body>

      </html>