3 Replies Latest reply on Oct 26, 2007 7:38 AM by Ilya Shaikovsky

    datatable sort column

    Blondel Michaël Newbie

      I would like to sort the column of my datatable

      I have this :

      <rich:column sortable="true">


      But the default is true. May I use "sortExpression" abd how can I use it ?
      Thanks

        • 1. Re: datatable sort column
          patrick schwarz Newbie

          Here is an example of how I got it working:

          <rich:column sortExpression="#{grant.grantContractTypeName}">
           <f:facet name="header">
           <h:outputText styleClass="required" escape="false" value="Grant/ <br/> Contract" />
           </f:facet>
           <h:outputText value="#{grant.grantContractTypeName}" />
          </rich:column>
          


          grant is a managed bean.

          • 2. Re: datatable sort column
            Blondel Michaël Newbie

            For me, it doesn't work. The column "Name" is not sortable. Nothing appends when I click on the header. Here is my simple example.
            Thanks

            <h:form>
            
            <rich:dataTable width="500" id="productList" rows="10" columnClasses="col"
             value="#{exaProductBean.products}" var="product">
            
             <rich:column id="Name" sortExpression="#{product.productName}">
             <f:facet name="header">
             <h:outputText styleClass="headerText" value="Name" />
             </f:facet>
             <h:outputText value="#{product.productName}" />
             </rich:column>
            
             <rich:column id="Vendor">
             <f:facet name="header">
             <h:outputText styleClass="headerText" value="Vendor" />
             </f:facet>
             <h:outputText value="#{product.vendor}" />
             </rich:column>
            
            </rich:dataTable>
            
            </h:form>


            • 3. Re: datatable sort column
              Ilya Shaikovsky Master

              such column sorting currently works only for rich:scrollableTable. Such support for simple table planned to 3.2.0 version