4 Replies Latest reply on Nov 22, 2011 4:28 AM by jbossesblearner

    Get rich:column sortBy working

    jbossesblearner Newbie

      Hello.

       

      Using 4.0.0.Final, I don't get sortBy working. My xhtml file looks like:

       

      "

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

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

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

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

          xmlns:ui="http://java.sun.com/jsf/facelets"

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

          xmlns:c="http://java.sun.com/jsp/jstl/core"

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

          <h:head/>

          <h:body>

       

            <f:view>

            <h:form>       

          <rich:dataTable id="table" value="#{myBean.items}" var="item" rows="20"

                  rowKeyVar="row" rowClasses="normal, alternate">

                      <rich:column id="idCol" sortBy="#{item.id}">

                              <f:facet name="header">

                                  <h:outputLabel value="id" />

                              </f:facet>

                              <h:outputText value="#{item.id}" id="id" />

                      </rich:column>

                      <rich:column id="secondCol" sortBy="#{item.second}">

                              <f:facet name="header">

                                  <h:outputLabel value="second" />

                              </f:facet>

                              <h:outputText value="#{item.second}" id="second"/>

                      </rich:column>

             </rich:dataTable>

      </h:form>

        </f:view>

        </h:body>

      </ui:composition>"

       

       

      Any help is appreciated. Thank you.