Friday, May 29, 2015

Load More Scroll Policy for ADF 12c Table and Range Paging

There is a new scroll policy for the table component in ADF 12c. This new policy is called - load more. I think it gives good potential, it allows to reduce access load on heavy tables. In ADF 11g we are implementing similar approach with RowCountThreshold = -1 setting, this is preventing full scroll at once (How To Disable SELECT COUNT Execution for ADF Table Rendering). Load more is better, it integrates with VO Range Paging and allows to configure maximum number of rows present on the client.

New scroll policy is configurable directly on the ADF UI table component, as a property:


Load more works based on configured Range Size for the iterator in the bindings. In my example, I have set it to be 15, this means there will batches of new rows added in the groups of 15 elements:


One of the key things - new scroll policy works with VO Range Paging, this allows to fetch less rows from DB and improve ADF BC runtime performance:


There is no need to set Range Size, it will be calculated automatically, based on the current set of rows rendered in the table on runtime.

This is how it looks like on UI. User scrolls in the range and is given option to Show More rows. Total number of rows is also visible:


What is good about Load more scroll policy, it doesn't keep all fetched rows. If user want to come back to the first set of rows, he will be given Show More rows option in the top of range - to display previous set of rows:


Below you can see SQL query executed to fetch rows in the current range. This query is based on Range Paging feature and contains range variables:


If I would navigate back in the range and display previous 15 rows:


New SQL query is executed with Range Paging, with different range variables:


What is good about it - SQL query range paging variables are calculated automatically, there is no need to implement any custom logic to keep them in synch.

One extra feature to be described - blockNavigationOnError (also available in ADF 11g). This could be useful feature, if you want to prevent selecting rows in the table, when there is validation error in the current row:


Row selection is blocked, until validation error will be fixed:


Download sample application - ADFTableLoadApp.zip.

5 comments:

Nitish said...

What is the performance change for this and Pagination (scrollPolicy = page)?

Andrej Baranovskij said...

There is significant improvement comparing to scrollPolicy=page, related to row fetch. With scrollPolicy=page, user could access last page and this will force ADF BC to fetch all rows in between.

Andrejus

Srikanth said...

Hi Andrejus,

I am using a list view and would like to disable the "load more items".

I wrote my own pagination and I am loading next set of rows through a page flow scope bean. Whenever row count exceeds 25, "load more items" kicks in automatically. I have set rows = 0, rows = 1000, deleted fetchSize, set fetchSize=size of the model. But none of these helps. Please let me know if there is a solution to this.

Srikanth

Unknown said...

Hi Andrejus,

the scrollPolicy="loadMore" not found in JDeveloper Version 12.2.1.3.0 ?

Andrej Baranovskij said...

Yes, is removed.

Andrejus