Since that time when I have developed any project, I get the long list of scrolled data in the tables, and I have many complaints from my customers whose they need pagination feature.
I have developed a custom ADF Declarative Component to solve the pagination problem, to be used in my projects to fit my customer requirements.
I am a frequent updater for Jdeveloper, and recently Oracle has released JDeveloper v188.8.131.52.0 and surprised me with many of new features released.
But the most exciting one of existing features is Table Enhancements but the top one is returning back the pagination feature, other enhancement as the following:
- Support for freezing the right most columns in a table so that a scroll bar appears on the left side of the frozen columns.
- Table/TreeTable - Both components allow configuration of the paging vs. scrolling via the new scrollPolicy attribute.
Let's see how we can achieve that through the following steps, figures and code snippets.
- Creating the project:
- File > New > General > Application >Items > Fusion Web Application (ADF) > click OK button.
- On the create page > click Finish (Alt + F).
- Application > Application1 should be created as the following fig:
- Creating the business and presentation:
- On ViewController project > Right click and choose New > Categories >Web Tier > JSF > Items > JSF Page > click OK.
- On create JSF Page pop up >File Name: ValueList.jspx > check "create as XML Document (*.jspx)" > In initial Page layout and content > choose: Quick start layout.
- Open Page Implementation >choose: Automatically Expose UI > leave everything as is.
- Your screen configuration should be as the following:
- Click OK.
- An Empty page will be open in the editor.
- Go to package view.backing under ViewController project >New > Categories >General >Java > Items > Java Class > OK > Name: Employee > OK.
- Employee, ValueList classes, adfc-config.xml and ValueList.jspx page should be as the following code snippets:
- Right click on ValueList.jspx page and choose run, and when it runs, you should see the following output:
- Rendering rules (VIP Note):
In order for a table to display as paginated, you must set the scrollPolicy attribute to page, the autoHeightRows attribute to 0, and the table must be placed in a flowing container (that is, a component that does not stretch its children). If these conditions are not met, the table will display a scroll bar.