ADF & JHeadstart
ADF skinning and resources
Feb 2nd
With my current, ADF Faces 11g, project, we have a requirement that the default text in the error message box is customized. Instead of ‘Messages for this page are listed below.’ it should read some other text. When you talk about customization you say ’skinning’. Skinning allows you to customize the userinterface, i.e. change the look and feel of the standard components. But besides the looks, it also allows you to change the default text messages that are sometimes included with the component.
The af:messages component presents errors and other messages in a comprehensible way to the users. It’s as easy as to put <af:messages id=”m1″ /> in the .jspx page and you’re done:
Now, let’s see how we can change the default texts like ‘Messages for this page are listed below.’ and ‘OK’…
Read the rest of this entry »
ADF 10g Dynamic Columns: Or how to implement an updatable dynamic table
Jan 11th
Although it is all about ADF 11g these days there are still some challenges in ADF 10g projects that run at some of my customers. Today I finished a task in which I had to create an updatable table in which the number of shown columns wasn’t known at design time. There is the possibility to create an ADF read only dynamic table, that works more or less like the richfaces columns <rich:columns/> http://livedemo.exadel.com/richfaces-demo/richfaces/columns.jsf?tab=usage&cid=3305454 element. However, I needed an updatable table, but ADF doesn’t know such a component. I had to come up with a different solution. Read the rest of this entry »
ADF 11g – implementing conditionally required input fields – by playing client side hide and seek
Dec 17th
The requirement I was dealing with today in ADF 11g Rich Client Components was the following: we have an input field that is required under certain conditions. Only when one of this cluster of fields has a value, is it required. Otherwise it is optional. The use case was that the fields represent a detail record. There does not need to be a detail record (optional) but if there is one (one of the fields in the detailrecord has a value), then certain fields are mandatory.
The desire was to dynamically set the required-ness of the inputText – depending on whether one of the items in the detail record cluster has a value or not. Dynamically means that when something changes with one of the items, the conditionally required item is immediately refreshed to either required or optional.

It turned out to be fairly easy to implement: the required attribute can be set using an EL expression that refers to a bean method. In the bean we can easily check the values of the other items and determine whether or not based on that assessment the inputText component is mandatory or not. By setting autoSubmit to true for all the items that determine the mandatoriness – and by adding the inputText as a partialTarget in the PPR request, we achieve the desired functionality. However … Read the rest of this entry »
Spring a surprise on a JSF developer – how Spring beans can become “JSF Managed Beans”
Dec 11th
Recently I was looking at a JavaServer Faces application, that did something relatively simple – but was exhibiting strange behavior. The output shown on the page (and this is a simplified version of the real life situation) was:
dlroWolleH
I had been asked to look into the situation and correct it. Before starting to make any changes I decided to familiarize myself with the application as it currently was. And then they almost tricked me.
The JSF page had a simple outputText component with an EL Expression in its value attribute. Something like:
<h:outputText value="#{someBean.property}"/>
I decided to take a look at the code for that bean, to understand the logic behind deriving the value of the outputText. So I first opened the faces-config.xml file to find the managed bean declaration that would tell me which class definition was behind the bean included in the EL expression. However, the faces-config.xml did not contain any managed bean definitions at all. None. And yes, I tried to see whether the web.xml specified any other faces-config.xml alternatives. But it did not.
Slowly it dawned on me Read the rest of this entry »
Java EE 6 and GlassFish 3.0 released!
Dec 10th
In the past few month several Java EE 6 related JSRs (Java Specification Requests) have been finalized. The final ballot for them ended on November 30 and all were approved. Today, December 10, 2009, Java EE 6 and GlassFish v3, THE reference implementation of Java EE6, are released.
ADF 11g – Extend and Override standard client side behavior by manipulating the Javascript prototype
Dec 8th
This article describes a way to extend and override the standard behavior of ADF client side JavaScript libraries. In this particular case we needed to learn about the client side validation errors in order to feed our expertise manager: when the user submits the form, client side validations are performed and when errors are found, these are presented to the end user. We would like to intercept this standard flow and also listen in to the list of validation error messages that will be shown to the end user.
A little debugging using Firefox quickly made it clear that the submitForm() method is invoked when a command button is activated and that it in turn (indirectly) makes use of the function processValidators() on the AdfHtmlPage object. This function will return true or false, depending on whether any validation error messages were produced by the collected validators that fire.
We can extend this function – without having to change any of the source code. The standard JavaScript way of overriding a method on an object is through the prototype of that object – and a reference to the original function.
The steps are:
ADF: simple EL expression to a method with params on a bean
Dec 4th
Based upon an old blogpost of Lucas "How to call methods from EL expressions- pre JSP 2.0 trick for JSPs with JSTL" I've created an ADF SecurityBean, so you can write EL expressions like "#{securitybean.isUserInRole['KING,ADMIN']}".
The idea is pretty simple. Use an innerclass that implements the getObject method of the map interface with your specific argument method and in your bean return an instance of this innerclass on the method with a readable and sensible name.
(the blog of Lucas explains why to use a class with a map interface).
ADF 11g: contextInfo to implement a common Fusion Applications pattern
Nov 26th
Oracle Fusion Applications are on the move. They were demonstrated at Oracle Open World 2009, they are current being tested with dozens if not hundreds of organizations and they have been promised for general availability later in 2010. Screenshots of selected modules are available on the internet, for example at: http://www.flickr.com/photos/oracleopenworld09/sets/72157622462805751/.
Fusion Applications are of interest to any ADF developer, as Oracle teams have worked hard – in close collaboration with the ADF development teams – to come up with UI patterns, ways of leading the end user through the application, presenting data and currently available actions in intuitive or at least consistent ways that would most likely work for most of our applications as well. And since we have the same technology stack at our disposal as the Fusion Apps teams have, we can see whether their best practices work for us too.
A recent addition to the catalog of ADF Faces components was the contextInfo component. It is quite heavily used in Fusion Apps for one such consistent pattern. The next screenshot illustrates this component:

The little orange markers in the upper lefthand corner of the Project Name fields – that is the manifestation of the contextInfo component. The popup you see for Stark Industries BI Rollout is the effect of activating the component. And it demonstrates its purposed rather nicely and effectively: whenever the user sees a contextInfo marker (the little oracle square) she knows that additional information associated with that field is available. The user can click on the marker and the context information is presented in whatever way the developer feels is most appropriate, though usually a popup will be used.
ADF 11g – the native AutoSuggest behavior
Nov 25th
The recent ADF 11gR1 PS1 release introduced a component we have been waiting for: the inputText with AutoSuggest. An inputText component that will present suggested values to the user depending on whatever text the user has already entered. The implementation in ADF of the functionality that got AJAX started, based on the original Google Suggest feature:

The auto suggest mechanism in ADF is not so much a new input component as it is a behavior (component) that can be added to inputText components. By adding the properly configured autoSuggest to an inputText, it is turned into an inputText with autoSuggest:
<af:inputText label="Country" value="#{item.country}"
columns="20" id="it5">
<af:autoSuggestBehavior suggestedItems="#{countrySuggester.getCountries}"/>
</af:inputText>
Here we have added the autoSuggestBehavior to an inputText that is used for entering a country. Of course we could have used a dropdown component, combobox or list of values. However, the auto suggest is somewhat more light weight and elegant especially when our collection of countries is far from complete, and we only have a limited number of suggestions to offer – and we certainly would not want to suggest that the user can only choose from the values we are proposing.

ADF 11g: Carousel is not just for images – on carousels with panelbox, tabs, panelform and input components
Nov 24th
Following on the heels of Luc's excellent post on the new ADF 11g carousel component – http://technology.amis.nl/blog/6514/jdeveloper-11112-carousel-component-as-master-and-detail – is another article that shows off this visually attractive component, using it in a slightly different way.
Even though the most logical application of the ADF 11gR1 PS1 carousel component is to use for displaying images, the component does not mandate that approach. We can create carousel-items that contain whatever we like – including forms with enterable items. The carousel can be used for example as an alternative way of presenting, browsing through and editing detail records.

As you can see in this screenshot, a carousel item can hold various nested components, such as PanelBox, PanelTabbed, PanelFormLayout and all kinds of input components.



