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

 

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. 

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

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

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.

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

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

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

Running the page after the migration without making any changes:

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

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.

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

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.

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

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

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):

<af:table id="stsentbl" value="#{staff.employees}" var="emp" varStatus="empstatus"  contentDelivery="immediate">

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:

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

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