1 Reply Latest reply on Jun 27, 2011 5:31 PM by Scott Jones

    Displaying additional pagination info for a rich:dataTable

    Scott Jones Newbie

      I'm using a rich:dataTable and rich:dataScroller combination (Richfaces 4.0.0/Facelets).  I have a requirement to display something like the following alongside the pagination control: "1-20 of 45 Reports <<rich:dataScroller here>>".

       

      Does anyone know how (or if it's possible) to get the total number of rows from a dataTable or the current page # of a dataScroller?

       

      Thanks,

      Scott

        • 1. Re: Displaying additional pagination info for a rich:dataTable
          Scott Jones Newbie

          I got this to work by modifying my backing bean (let's call it "bean").  I added a "getNbrItems()" method and a "page" property.  I then set the "page" attr of the <rich:dataScroller> to "#{bean.page}". 

           

          I then put the calculation in an <h:outputText> and set the "render" attribute of <rich:dataScroller> to the id of my outputText.

           

          I wish there was a way to do this without modifying the backing bean but based on my digging around there doesn't appear to be.

           

          Scott