4 Replies Latest reply on May 12, 2010 3:09 PM by bking007

    sorting data using rich:dataTable

    bking007

      I am using rich:dataTable for sorting and filtering the data. For some reason, when I click on the column to sort data, it is sorting only the data in the current view (first 25 results). How can I sort on the entire data in ASC or DESC order? Is it possible? I have also tried commenting out setMaxResults(25) in the action class, but with no luck yet. Please lemme know your inputs. Thanks!

        • 1. Re: sorting data using rich:dataTable
          sappo

          Hi Bart,


          it would be really helpful if we could take a look at your sorting approach.

          • 2. Re: sorting data using rich:dataTable
            bking007

            It's the same basic code that I am using -


            <rich:dataTable id="cList" var="_cSets" value="#{cList.resultList}" rendered="#{not empty cList.resultList}">                    
                <rich:column  sortBy="#{_cSets.name}" filterBy="#{_cSets.name}" filterEvent="onkeyup">
                    <f:facet name="header">SET NAME</f:facet>
                    <h:outputText value="#{_cSets.name}"></h:outputText>
                 </rich:column>
            </rich:dataTable>



            • 3. Re: sorting data using rich:dataTable
              sappo

              Hi Bart,


              your problem is that the rich:dataTable build-in sort method works on the current view assigned to it only. If you like to query over the whole resultset you've to do an external search. Take a look at the *List.xhtml files seam-gen generated for you.


              Kevin

              • 4. Re: sorting data using rich:dataTable
                bking007

                Thanks Kevin. It was helpful.