Saturday, August 1, 2009

Range Paging Last operation, bug workaround

As i posted in previus post when you use Range Paging on a view object then Last operation throws an error.

As Steve suggested i created a method that takes you to the last row:

private Row rangePagingLast() {
int pagesCount = getEstimatedRangePageCount();
Row lastRow = getRowAtRangeIndex(getRowCountInRange()-1);
return lastRow;

This method actually gets you to the last row even though Range Paging is set on a view object
It is also much faster than scrolling down to a table component or Last operation of a view object that has Scrolling as Action Mode.
So i overide my base View Object Implementation Class and the Last operation to support Last operation even if Range Paging is set.

public Row last() {
if (getAccessMode()==ViewObjectImpl.RANGE_PAGING) return rangePagingLast();
return super.last();

It seems to work fine.

Test case:

No comments:

Post a Comment