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.
http://adfbugs.blogspot.com/2009/07/performance-tuning-range-paging-last.html

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

private Row rangePagingLast() {
int pagesCount = getEstimatedRangePageCount();
scrollToRangePage(pagesCount);
Row lastRow = getRowAtRangeIndex(getRowCountInRange()-1);
setCurrentRow(lastRow);
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.

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

It seems to work fine.



Test case:

http://adfbugs.googlecode.com/files/TestRangePaging.zip

No comments:

Post a Comment