Sunday, February 10, 2013

ADF BC - Scrolling To The Last Row

There is last() function in ADF BC - it allows to get last row from the rowset (be aware, it will fetch all rows until the last one - Method - createInstanceFromResultSet() for ADF BC Database Fetch Monitoring). Besides returning last row from the rowset, last() function sets last row to be the current row. Depending on the use case, we may need only to get last row - without setting it to be current. This is possible, I will describe how to scroll to the last row in the rowset (scrolling also fetches all rows in between, same as last() function).

Here is example of last() function call - it retrieves last row:


Get Last button was pressed - last row was retrieved by last() function and in addition on ADF UI table row selection was changed to point to the last row:


If we want to avoid last row becoming current - here we have last row retrieval implementation with scrolling. Scrolling is implemented for rowset range page count. We scroll first to the last range page and then retrieve last row from that page:


Table row selection on ADF UI remains as it was before getting last row data:


Download sample application - ADFScrollingToLastApp_v2.zip.

3 comments:

Rohan Walia said...

Nice article Andrejus !!

Andrej Baranovskij said...

Thanks Rohan !

Andrejus

Victor David said...

I need this more than you know!! thank you Andrejus!!