RichFaces 3.1.3 released

Posted by    |       Rich Faces

Updated - added in <rich:orderingList /> and specify the locale for the calendar

The RichFaces team have released RichFaces 3.1.3.GA. This is the first release since 3.1.0 back in September to include any new components (both 3.1.1 and 3.1.2 were bug fix releases) so I wanted to highlight the key improvements for you.

Time Picker

What's really great about the RichFaces timepicker is that it is integrated into the calendar control - you can easily choose to provide a graphical control for the date, the time or the date /and/ the time This is really easy to use - just bind the calendar control to the model as usual
<rich:calendar value="#{flight.departureDate}"
               datePattern="dd/M/yy hh:mm" />
As you can see, it's also fully internationalisable!

Controlling one component from another

<rich:componentControl /> allows you to fire an action on another component when a javascript event occurs on your current component. This is very powerful, and perhaps hard to understand until you need it, so lets look at a very simple example. Here we have a modal panel (a bit like a css/div based popup), which we want to launch from somewhere in our page:

<rich:modalPanel id="panel" width="350" height="100">
  <f:facet name="header">
    <h:outputText value="Modal Panel" />
  <h:outputText value="This panel is called using rich:componentControl"/>
<h:outputLink value="#">
  Show Modal Panel
  <rich:componentControl for="panel" attachTo="link" operation="show" event="onclick"/>

Rather than having to call some JS function, we can just attach a component controller to the link, and tell it what operation to call on what component.

<rich:componentControl /> can do a lot more than this - take a look at the online demo for ideas.

Shuttle list

As I've come to expect from the RichFaces guys, a really slick looking control, it's also simple to use:
<rich:listShuttle sourceValue="#{items.availableItems}"
            sourceCaptionLabel="Available Items"
            targetCaptionLabel="Currently Active Items">

  <rich:column width="18">
    <h:graphicImage value="#{item.icon}"/>
    <h:outputText value="#{item.label}"/>

Notice how we've embedded other rich components to layout the lists!

Orderable list

Another similar component is the orderable list. Here's how you use it:
<rich:orderingList value="#{myMusic}" var="album">

    <f:facet name="header">
      Song Name
    <h:outputText value="#{album.title}"/>

    <f:facet name="header">
      Artist Name
    <h:outputText value="#{}" />


Context sensitive menu

RichFaces already has components for rendering a menu bar, and 3.1.3 adds a right-click menu.
<s:div id="flower">
  <h:graphicImage value="flower.jpg"/>
  <rich:contextMenu event="oncontextmenu" 
    <rich:menuItem value="Zoom In" 
    <rich:menuItem value="Zoom Out" 
Here we've attached the context menu to the parent <s:div /> component, so any right click on it causes the menu to show.

There's also

  • Big improvements to Portal support (we are just finishing off support for Seam and RichFaces in a portlet)
  • A system for customising how styles are loaded (one big lump, or on demand)
  • Over 180 bug fixes (see the release notes)

Congratulations to the RichFaces team!

Back to top