Posts tagged rich faces
Using custom functions in EL expressions in JSF 1.x
Jan 17th
EL expressions are one of the main driving forces for JavaServer Faces. Most dynamic characteristics of pages and widgets are governed by EL expressions. In JSF 1.x, there are some limitations for EL expressions that can at times be a little frustrating. One of the limitations is the fact that no custom functions or operators can be used in EL expressions. Quite some time ago, I wrote this article – http://technology.amis.nl/blog/622/how-to-call-methods-from-el-expressions-pre-jsp-20-trick-for-jsps-with-jstl – to demonstrate a trick for using a Map interface implementation to access custom functionality from EL expression after all.
However, things can even be better. Rather than jumping through the somewhat elaborate hoops of implementing the Map and consructing complex EL expressions, there are two other approaches. One is to create a custom EL Resolver can configure it in the faces-config.xml. Another is discussed in this article. It involves registering custom Java methods as eligible for use in EL expressions. And that really makes life a lot easier. It allows us to create EL expressions such as:
#{cel:concat (cel:upper( bean.property), cel:max(bean2.property, bean3.property), cel:avg(bean4.list))}
or
#{cel:substr(bean.property, 1, 5)}
Implementing Cell Highlighting in ADF 11g RichTables
Nov 8th
The Oracle Technology Network just published my two part series on implementing Cell Highlighting in ADF 11g Rich Faces Table components. The articles describe how you can have the end-user set up rules for assigning background colors to the cells in a column, depending on the value in the cell.
The highlighting can be based on thresholds – for example green for salaries under 1200, red for salaries over 3000 and yellow for salaries in between – or on expressions. The latter allows the user to specify one or more logical conditions, using EL syntax and references to the data attributes used in the table; a color is associated with each conditionthe. The first condition satisfied by a row determines its color. For example condition ‘[job]==’MANAGER’ and [sal] < 4000′ (pink) and another condition ‘[hiredate].month < 7 and [deptno] != 30′ (olive).

The article also gives some interesting examples of using some ADF 11g RichFaces features like Popup, programmatic Partial Page Rendering, embedded (region) Bounded Task Flow with input parameters, programmatic EL evaluation, oh eh… and the Color Picker..
You can find the first article at: http://www.oracle.com/technology/pub/articles/jellema-adfcellhighlighting.html. The link for Part Two is here. I have created a similar article for ADF 10g using the ‘traditional’ components – I intend to make that available shortly.
ADF 11g RichFaces – handling the client side double click to invoke a server side operation
Oct 31st
Selecting a row in a table with search results to drill down to its details is a fairly common operation in web application. I have implemented such functionality many times, in web applications based on JSP/TopLink, JSP/BC4J, JSF/Pojo, ADF 10g Faces/ADF BC. They are all similar, and they are all different. Today, I will do this in ADF 11g RichFaces on top of ADF BC – although the Model implementation is hardly relevant.
I am quite convinced that there are several ways to implement this functionality. I just picked one – and it works. Based on this article, you can easily achieve other results, for example from a single click on a table row (selection event) or a keypress on a row. My implementation will absorb the double click event on a row in the table and take the user to the detail page with the edit form for that record. The double click is captured on the client, transformed to an event that is queued and consumed by a server listener that invokes a managed bean. The method on this bean that retrieves the selected row from the table – the source of the event – and navigates to the Form Page. This page has a BindingContainer that executes the setCurrentRowWithKey to ensure the right (selected) record is presented for editing.
Read the rest of this entry »



