Thursday, April 11, 2013

How To Control ADF Table Pagination on Runtime and Do Case Insensitive Search

I decided to update my sample app from previous post - ADF 11g PS6 - ADF 10g Table Pagination Feature is Back Finally with option to change page size dynamically on runtime. Change between scroll and page mode is implemented, plus case insensitive table column filter option is enabled. Updated sample - comes with choice list to select page size:

There is button to force page size change, it calls af:setPropertyListener:

Listener is copying selected page size from choice list and sets Range Size in table iterator. Table Fetch Size by default is set to be equal iterator Range Size - this is how we can change dynamically table page size:

FetchSize is equal table iterator Range Size:

Switch between scroll and page modes is implemented in backing bean - changing scroll policy and doing surrounding panel collection PPR:

By default, when table is loaded - 10 rows are displayed:

You can change to 25 rows:

Switch between scroll and page modes from panel collection menu:

Rendering scroll mode now - no option to change page size, all rows are displayed:

This is how we can control table layout.

Let's see how column case insensitive search works - this is just one property change for the af:column tag. Try to search for First Name - "steven":

There will be no results - by default case sensitive search is executed in ADF table:

How to enable case insensitive search for af:column - easy. Select af:column you want to apply case insensitive search:

Set "caseInsensitive" for FilterFeatures property of af:column:

Search again for "steven" - this time result is available:


Dang Viet Ha said...

This is the new version of JDeveloper and ADF, right? Could you explain me what the PSx mean?

Thank you

Andrejus Baranovskis said...

PS6 is just a short name for


Nikhil Kamthe said...
This comment has been removed by the author.
Andrejus Baranovskis said...


I tested now, it works as expected. After sorting - pagination doesnt disappear.


Nikhil Kamthe said...

Also when i try to change the rangeSize of my tableVO from backing bean by setRangeSize(int), it doesnt get replected in the page

Andrejus Baranovskis said...

You should double check my sample app, it all works there.


Nikhil Kamthe said...


Thanks for your reply.
If I add a setPropertyListener inside the button it works fine.
But when i try to change it in my backing bean, it doesn't get reflected on the screen.

Anonymous said...

Nikhil, Just retrieve the iterator used for the table and call setRangeSize on the iterator as well setRangeSize on VO..this way it works.



Sanjeeb Mahakul said...

Hi Andrejus,

I have a requirement to move to next page programmatically. I have a rangeSize 10 defined which will fetch 10 records/page, but based on some business logic i need to move to next page(or nth page).
Details of the thread is available at :

Can you please suggest something .

Andrejus Baranovskis said...

You can use out of the box table pagination available from PS6.


Anonymous said...

Hi Andrejus,
I am using new version of JDeveloper and use the property scrollpolicy = 'page' and deployed the application on weblogic server den Table pagination is working fine.
But when we are using weblogic server It is giving error:-

Error 500--Internal Server Error
weblogic.servlet.jsp.CompilationException: Failed to compile JSP /search.jspx
search.jspx:352:29: This attribute is not recognized.
scrollPolicy="page" autoHeightRows="0">

Andrejus Baranovskis said...

May be there is no correct ADF runtime on this newer server?


Anonymous said...

I am achieving the pagination functionality.
Pagination nav bar is displaying below the table.
I need to display the pagination nav bar above the table.

Could you please suggest how to achieve the same?

Thomas Lassauniere said...

Hello Andrejus

I need help to implement your example.
I don't understand how to force table to execute query after clicking on the "Change" button.
I execute your example and it works fine but when I'm trying to redo the same thing, I have to refresh my all web page to see Range Size modification.

If you could help me, thanks

Thomas Lassauniere said...

Andrejus, I found a solution for my refresh problem.

I'm using new Jdevelopper 12C and by default, it adds into web.xml deployment profile a context-param name "" enabled by default.

I removed thes line from web.xml file and now it's working as expected.

Hope that this will help.

Anonymous said...

i have this problem: my rangeSize=50 and the query return a greater number of rows(1700), my boss does not want a rangeSize that big becouse the app is getting slower, the problem reside when i want to select one row, gives me the null pointer exception only when the size of the query is bigger than the rangeSize, if the query returns 50 or less rows everithing works fine, what should i do if i can´t move the rangeSize from there?

Andrejus Baranovskis said...

I'm not sure, this would require testing your app. Ask your boss to hire us to help :-)))


Anonymous said...

I have a requirement of ADF table pagination and select table row by using check box.
But when i go to next page using pagination and then come back to the first page the selected checkbox value getting reset.
I have checked the update property of the attribute is also marked as always and in the VO tuning 'persist transient attributes' is also marked.
Still the checkbox values getting reset.

Anonymous said...

Thanks Thomas Lassauniere...It helped!!!