2 Replies Latest reply on Sep 16, 2010 12:37 PM by Krishan Kumar

    lastPageMode="full" is not working

    Krishan Kumar Newbie

      Hi

      I have a rich:dataTable on one page having a data scroller in its footer. It shows 10 records per page. But if there are not exactly 10 records on the last page (as it is shown in the image 2) then the size of data table shrinks automatically. What I want here is I want to keep the number of rows consistent across all pages. I mean if there are not enough records to show on the last page the blank rows should be added at the end of table. And, it should show 10 rows in any case. Could you please devise me a solution so that I can keep the number of rows consistent across all pages.

      I have a rich:dataTable on one page having a data scroller in its footer. It shows 10 records per page. But if there are not exactly 10 records on the last page then the size of data table shrinks automatically. What I want here is I want to keep the number of rows consistent across all pages. I mean if there are not enough records to show on the last page the blank rows should be added at the end of table. And, it should show 10 rows in any case. Could you please devise me a solution so that I can keep the number of rows consistent across all pages.

       

      I tried lastPageMode="full" but it did not work for me.

        • 1. Re: lastPageMode="full" is not working
          Harut Sargsyan Apprentice

          you have to add corrsponding logic in the method where you initializing the collection of the datatable elements.

          Write corresponding business logic for adding an empty elements in the collection... Somethong like this:

          int countOfEmptyElements = (10 - yourCollection.size() % 10);

          for(int i = 1; i <= countOfEmptyElements; i++) {

                    yourCollection.add(new YourBean());

          }

          1 of 1 people found this helpful
          • 2. Re: lastPageMode="full" is not working
            Krishan Kumar Newbie

            Thanks Harut!

            This solution I had in mind but I did not want to add rows to my Collection. Although the lastPageMode="full" is working now. The mistake I was doing is using older version of richfaces. Now I am using richfaces 3.3.3.Final. I got the jars and it is working now.