Migrating the ADF 10g Hierarchical Table Report to JDeveloper & ADF Trinidad and onwards to 11g (RichFaces)

0

 

In a recent article, I discussed how to create a fairly structured hierarchical report – table style – using ADF 10g not-so-rich Faces – see creating-a-read-only-hierarchical-table-report-with-adf-10g. The temptation is very large to open the project from that article in JDeveloper 11g and see what I can do with the RichFaces components to spice it up a little.

Before even getting started,. it seems that the popup component can help make things somewhat more attractive, as probably can the chart and gauge components. Furthermore, perhaps the Tree DataBinding is somewhat more versatile in 11g than in 10g and can even further reduce the programmatic effort. And who knows what other benefits 11g RichFaces may offer…

 

When opening the JDeveloper 10g Application in JDeveloper 11g, the migration wizard kicks off. It converts the files that make up the 10g Application. It applies some structural changes to the ADF BC definition files and updates ViewController project to cater for the move from JSF 1.1 to 1.2 and JSP/Servlet to their respective higher release levels. 

The ADF Faces 10g components do no longer exist in the same old way in the ADF 11g context. They have been replaced in two ways:

1. with the Trinidad components that offer very similar functionality as the ADF Faces 10g components – with some extras like charts and inputNumberSpinbox  -

2. with the ADF 11g RichFaces library that offers very rich, Web 2.0 style components that in the core are replacements for teh 10g components – RichTable, RichTree are the natural successors to the Table and Tree in 10g.

The migration wizard replaces the 10g components with their Trinidad counterparts – not the RichFaces components. So after the migration, you get an ADF 11g Trinidad based application.

Running the page after the migration without making any changes:

The one issue I had is that the ShowDetailHeaders did not PPR properly when opened or closed. It turned out that they had no Id attributes. I had to add some Id attributes that in 10g apparently were not required – only desired – but in 11g Trinidad make the difference.

Enter ADF 11g RichFaces

It is nice to have the same page running in JDeveloper 11g on WebLogic 10.3 and using the Trinidad component set, but I was really hoping for some new functionality. And that probably should come from the ADF 11g RichFaces library.

Therefore I add the appropriate libraries to the project, set up the RichFaces (and DVT) Tag Libraries and recreate my page using af: tags once more rather than the tr: tags produced by the migration wizard.

In the end, the code in my page I almost the same as with the 10.1.3 ADF libraries. I had to change a panelGroup to a panelGroupLayout. I also needed to explicitly set the contentDelivery attribute on the inline table (for Staff Seniority):

&lt;af:table id=&quot;stsentbl&quot; value=&quot;#{staff.employees}&quot; var=&quot;emp&quot; varStatus=&quot;empstatus&quot;  <strong>contentDelivery=&quot;immediate&quot;</strong>&gt;

otherwise the table would not get any data when the showDetailHeader was disclosed in the client.

I also needed to change the type for the employeesTable property in the DepartmentAnalyzer bean:

private RichTable employeesTable

instead of CoreTable that I used before.

In that class I also had to change some imports, for example for

import oracle.adf.view.rich.context.AdfFacesContext;

After making these very tiny changes, I could once again run my -now rich page:

The next step is really benefiting from the rich goodies – popup, gauges etc. That’s for a next another article.

Share.

About Author

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director for Fusion Middleware. Consultant, trainer and instructor on diverse areas including Oracle Database (SQL & PLSQL), Service Oriented Architecture, BPM, ADF, Java in various shapes and forms and many other things. Author of the Oracle Press book: Oracle SOA Suite 11g Handbook. Frequent presenter on conferences such as JavaOne, Oracle OpenWorld, ODTUG Kaleidoscope, Devoxx and OBUG. Presenter for Oracle University Celebrity specials.

Comments are closed.