3 Replies Latest reply on Dec 15, 2008 9:50 AM by lemonchik

    ScrollableDataTable built in Sorting does not work.

      Hello!

      I have a simple Code in order to test:

       <rich:scrollableDataTable id="test" rowKeyVar="rkv" sortMode="single" var="text" value="#{testBean.textList}">
       <rich:column id="text" sortBy="#{text}">
       <f:facet name="header" >
       <h:outputText value="Sort"></h:outputText>
       </f:facet>
       <h:outputText value="#{text}"></h:outputText>
       </rich:column>
      </rich:scrollableDataTable>


      but it doesn't works. The same code is working by <rich:dataTable> und <rich:extendedDataTable> as expected.

      Have I to use a sorting feature by scrollableDataTabe in another way?

      ( I'm using RichFaces 3.2.2 )

      Thanks!


        • 1. Re: ScrollableDataTable built in Sorting does not work.

          I found the problem out. The Sorting is working if i have the plain objects only. I hit on problems by using nested objects. I suppose the column ID cannot be resolved correctly.

          For example:

          <rich:scrollableDataTable rowKeyVar="rkv"
          value="#{customerHandler.personList}"
          var="customer"
          sortMode="single">
          
          <rich:column id="lastName" width="120px">
          <f:facet name="header"><h:outputText value="Lastname" /></f:facet>
          <h:outputText value="#{customer.lastName}" />
          </rich:column>
          
          <rich:column id="street" width="120px">
          <f:facet name="header"><h:outputText value="Street" /></f:facet>
          <h:outputText value="#{customer.address.street}" />
          </rich:column>
          
          </rich:scrollableDataTable>
          



          The first column will be sorted, but the second will not.

          Has anybody any ideas ???

          • 2. Re: ScrollableDataTable built in Sorting does not work.
            konstantin.mishin

            You should use sortExpression attribute for column inside scrollableDataTable instead of sortBy.
            Like:
            <rich:column id="street" width="120px" sortExpression ="#{customer.address.street}">
            <f:facet name="header"><h:outputText value="Street" /></f:facet>
            <h:outputText value="#{customer.address.street}" />
            </rich:column>

            • 3. Re: ScrollableDataTable built in Sorting does not work.

              Yes, it's working !!! Thank you so much.