org.kuali.rice.kns.util
Class TableRenderUtil

java.lang.Object
  extended by org.kuali.rice.kns.util.TableRenderUtil

public final class TableRenderUtil
extends Object

This class provides utilities to support the rendering of tables in Kuali without using display tag. Normally, displaytag handles the rendering of Kuali tables on various screens, but there are situations where displaytag is inadequate for the task (e.g. multiple value lookups). In particular, display tag does not handle POSTing of forms when switching between pages and sorting.


Method Summary
static int computeLastIndexForPage(int pageNumber, int resultSize, int maxRowsPerPage)
          This method computes the index of the last row of the given page
static int computeStartIndexForPage(int pageNumber, int resultSize, int maxRowsPerPage)
          This method computes the list index of the first row of the given page
static int computeTotalNumberOfPages(int resultSize, int maxRowsPerPage)
          Returns the minimum number of pages needed to display a result set of the given page
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

computeTotalNumberOfPages

public static int computeTotalNumberOfPages(int resultSize,
                                            int maxRowsPerPage)
Returns the minimum number of pages needed to display a result set of the given page

Parameters:
resultSize - number of results
maxRowsPerPage - maximum number of rows
Returns:

computeStartIndexForPage

public static int computeStartIndexForPage(int pageNumber,
                                           int resultSize,
                                           int maxRowsPerPage)
This method computes the list index of the first row of the given page

Parameters:
pageNumber - first page is index 0
resultSize - the size of the list being rendered
maxRowsPerPage - max number of rows on a page
Returns:
the index in the result list of the first row of the given page

computeLastIndexForPage

public static int computeLastIndexForPage(int pageNumber,
                                          int resultSize,
                                          int maxRowsPerPage)
This method computes the index of the last row of the given page

Parameters:
pageNumber - first page is index 0
resultSize - the size of the list being rendered
maxRowsPerPage - max number of rows on a page
Returns:
the index in the result list of the last row of the given page


Copyright © 2005-2011 The Kuali Foundation. All Rights Reserved.