Search code examples
javatapestry

Supressing rowsPerPage (pagination) in Grid of Tapestry


Is there any way in Tapestry 5 to suppress pagination for a gird component?

I searched all over the internet, couldn't find a solution. I have a requirement to display a grid with the full list regardless of it's length. My observations:

  • I tried t:rowsPerPage=0 but got a divide by zero error.
  • Tried -1 as well, didn't work.
  • If I remove rowsPerPage entirely, I see 25 rows. (Looks like this must be the default value.)

Solution

  • You can see from the javadoc that the default is symbol:tapestry.components.grid_rows_per_page so you could override this symbol if you'd like to do it globally. Another option is:

    TML

    <t:grid source="..." rowsPerPage="prop:rowsPerPage" />
    

    Java

    public int getRowsPerPage() {
       return Integer.MAX_VALUE;
    }