Wednesday, December 19, 2012

JSF: Read HTTP Header parameters

Issue:
How to read  HTTP Header parameters using JSF?

Solution:
Reading the http headers parameters in JSF is possible using the ExternalContext.

Saturday, November 17, 2012

Oracle ADF Essentials


Oracle Application Development Framework (Oracle ADF) is a Java EE development framework that simplifies and accelerates enterprise application building. Oracle ADF Essentials is a free packaging of this framework  that can be used to develop and deploy applications without licensing costs.

Saturday, October 6, 2012

JSF: setting EL expression programmatically

Issue
Create a JSF component programmatically and setting a property dynamically (eg disabled, visible, etc).

Solution
Java Server Faces provides an expression language (JSF EL)  used in web application pages to access the JavaBeans components in the page. It is possible to set it programmatically using a javax.el.ValueExpression, an abstract class that provides the API for the Unified Expression Language.

Monday, August 6, 2012

Oracle ADF: af:navigationPane instead af:panelTabbed


Issue

Show Database table rows in an ADF Page using tabs: Each tab have to represent a table record and content's information, there could be many tabs to show.

Solution

The tab content has the same structure for every DB table row. It's possible to use the af:panelTabbed and af:showDetailItem for each row, iterating it with an af:iterator.

  <af:panelTabbed>
     <af:iterator>
       <af:showDetailItem>
         .....
         <!-- tab content -->
         .....
       </af:showDetailItem>
     </af:iterator>
  </af:panelTabbed>

This approach has a disadvantage: the page is rendered with each tab and its content, duplicating the tab detail for each rendered tab (tab content could be very complex). If, in the page, there are many tabs it could slow down the page behavior.
An alternative approach could be simulate the tab behavior using an af:navigationPane. In this case a af:forEach iterates the tabs component represented by the af:commandNavigationItem.