Tuesday, April 2, 2013

ADF 11g PS6 - ADF 10g Table Pagination Feature is Back Finally

Do you remember good old feature from ADF 10g - table pagination? So many customer requests I have heard to have it back in 11g and finally in ADF PS6 we have it. Not all good features mean bad, table pagination is perfect example. Some two years back I blogged sample application for custom table pagination like behavior - Oracle ADF 11g Custom Table Pagination.

Table pagination is out of the box in ADF 11g PS6:


Implementation steps are pretty simple. Firstly you should set scrolling policy to Page:


AutoHeightRows must be set to 0 and make sure that FetchSize is equal Range Size. FetchSize property determines how many rows are shows in single table page:


In this example I have set RangeSize = 10, this is how many rows are shown in table page:


Download ADF 11g PS6 sample application - TablePaginationApp.zip.

Update April 3rd, 2013:

Blog reader was asking if table pagination works in plain page - yes it works. Here is updated sample application - TablePaginationApp_v2.zip. Table with pagination is implemented directly inside main page, without any layout wrapping components, just below af:form:


Table pagination is rendered operational and without warnings in Google Chrome:


Work the same in IE:

28 comments:

alkhateeb said...

Thanks alot,
nice to have again ,
I have a question ,
what do you mean of ADF PS6
Thanks a lot,

Andrej Baranovskij said...

There was new ADF 11g PS6 release published yesterday, check on OTN.

Andrejus

Timo said...

Andrejus, when you try to run a paged table in a jspx page (not in a fragment) you need to surround hte table with a panelGroupLayout in scroll mode to see the pagination bar.
otherwise you get an warning like
-TableRenderer- -_isPagingMode- falling back to scrolling mode since we need parent component to flow and authHeightRows=0


Timo

Andrej Baranovskij said...

There is no such warning in my sample app, because AutoHeightRows = 0 and I'm using showDetailItem - it allows to flow.

Andrejus

Andrej Baranovskij said...

Hi Timo,

I tested with simple page - pagination works for table, without wrapping table into panelGroupLayout. It works with table being under simple af:form as root.

You should double check it.

Andrejus

Anonymous said...

does this feature exists in 11.1.2.3?

Andrej Baranovskij said...

No, only new ADF 11g PS6 from this week.

Andrejus

ahmad abuayyash said...

its only in ADF 11g R1

Andrej Baranovskij said...

Yes, as the blog title suggests ;)

ahmad abuayyash said...

so if i have application developed in ADF11g R2 what shall i do :-(

Andrej Baranovskij said...

Thats a problem I'm facing also. I think Oracle release management is a bit strange with these R1 and R2 parallel branches. There is nothing as only to wait for 12c, when we could migrate from R2 directly to 12c.

Andrejus

Timo said...

Andrejus, I checked it out again and it turned out that you can't put the table in a stretch layout container. It has to be in a layout container in scroll mode. I wrote a sample and blog about it here http://tompeez.wordpress.com/2013/04/03/jdev-11-1-1-7-0-table-pagination-beware-of-the-layout-container/

Andrej Baranovskij said...

It was working for me even in simple page, just under af:form. May be its your browser issue? I was testing with google chrome.

Do you mean something is wrong with my sample app?

Andrejus

Andrej Baranovskij said...

Hi Timo,

I posted updated sample app (read in this post above), where table with pagination is just above af:form. And it works well. Please test it.

Andrejus

Anonymous said...

Hi Andrejus
when I use paging in table with 2 column paging navbar does not show complete how can I fix it?

Andrej Baranovskij said...

You need to give enough space - otherwise it will be rendered as compact.

Andrejus

Anonymous said...

I've tried the new pagination. I've a problem when using an edit form on a separate page fragment. When the user saved the changes I execute the iterator to refresh the data in the table.I use get/setCurrentRowKeyString to reactivate the current row after the refresh. But when I'm on a page greater 1, ADF always displays the first page in the table and not the page the row is displayed on. How can I fix this?

Andrej Baranovskij said...

Good question - I will check this.

Andrejus

Mikhail said...

I am trying to use the pagination feature in jDeveloper 11.1.2.4.0 and downloaded your test project. I am getting the error on this attribute on table: scrollPolicy="page".
It does not show in the property inspector as well.

Any idea why ?

Thanks

Mikhail

Andrej Baranovskij said...

Means you are using wrong JDEV version, should be PS6.

Andrejus

Mikhail said...

I know I have next version of jDeveloper..just not sure why next version does not support something which pervious has introduced.

Regards

Mikhail

Andrej Baranovskij said...

You should check release notes.

Andrejus

Bogdan Dancu said...

Hi,

I've tested the pagination feature.

1. The "Last Page" button doesn't seem to work well, it advances from page 1 to 2 for example (I only have 2 pages), but the grid still displays data from page 1.

2. Can the pagination control from the grid's footer be separated from the grid? It's annoying because I have a vertical splitter, the grid is in the top facet in a panelCollection, and I had to put the panelCollection in a panelGroupLayout scrollable, so it scrolls the entire panelCollection. I want that the pagination control to be always visible no matter where the scroll is.

Many thanks,
Bogdan.

BB said...

When I click on View->Columns->Show All, Why the all the control in the right side of the pagination such as previous, begin, next, end, and the page number, are disappeared ? Thanks

Anonymous said...

We are using standard ADF UI components (ADF Table Pagination feature) and when all the rows fit in one page, the Page X of X (x-x of x items) is not displayed.

Is this a limitation or have we missed some property settings?

Thanks in advance!

Saurabh said...

Hi,
Nice info.
I am facing an issue where when I use scrollPolicy="page", and zoom in/out browser the rows from table disappears and on further action I comes back.

Any suggestions?

Saurabh

Andrej Baranovskij said...

Hi,

This is tricky, it could depend on outer UI layout components structure in your page.

Regards,
Andrejus

Saurabh said...

Found solution. columnStretching was the issue.
Thanks for quick reply :)