protected void validateValues()
{
ITableModel objModel = getTableModel();
// make sure current page is within the allowed range
ITablePagingState objPagingState = objModel.getPagingState();
int nCurrentPage = objPagingState.getCurrentPage();
int nPageCount = objModel.getPageCount();
if (nCurrentPage >= nPageCount) {
// the current page is greater than the page count. adjust.
nCurrentPage = nPageCount - 1;
objPagingState.setCurrentPage(nCurrentPage);
}
if (nCurrentPage < 0) {
// the current page is before the first page. adjust.
nCurrentPage = 0;
objPagingState.setCurrentPage(nCurrentPage);
}
}