Archive for the ‘Rich Faces’ category

Web Form Validation with JBoss RichFaces and Hibernate Validator

February 9th, 2010

Last month I posted about Building a Dynamic Tree with JBoss RichFaces and Spring Web Flow. Since then, I have received a few requests to demonstrate how to implement validation within the modal dialog. There are several internet resources that already deal with this but none that provide a complete working example so I decided I would do just that.

You can download the source code in the form of a Maven project and follow along.

Hibernate Validator Dependencies

First step is to add the Hibernate Validator dependency to the project pom. I have used Hibernate Validator 4.0.0.GA because it is a JSR 303 compliant implementation.

<dependency>
  <groupid>org.hibernate</groupid>
  <artifactid>hibernate-validator</artifactid>
  <version>4.0.0.GA</version>
  <scope>compile</scope>
</dependency>

Listing 1 : Hibernate Validator Dependency

» Read more: Web Form Validation with JBoss RichFaces and Hibernate Validator

Building a Dynamic Tree with JBoss RichFaces and Spring Web Flow

January 19th, 2010

Recently I was involved in a project that required a user interface that would facilitate the manipulation of a hierarchical data structure.  I was already using JBoss RichFaces so it made perfect sense to utilise the tree and associated components (i.e. recursiveTreeNodesAdaptor and treeNode).  The project was also utilising the Spring Framework and Spring Web Flow and these were also incorporated into the eventual solution.

To start with, as any good developer does, I searched for existing solutions to the problem and while I found some useful information I did not find exactly what I was looking for.  With this in mind, when I eventually finished the development of the user interface I decided I would share my implementation and hopefully you will find what follows useful.

To allow you to follow along, I have made the source (maven project) available as a download.  This way, I do not have to worry about explaining everything in minute detail.

For a preview, you can always build the source, deploy to a server and navigate to http://[server]:[port]/dynamic-tree/spring/flow-main replacing the [server] and [port] with appropriate values.
» Read more: Building a Dynamic Tree with JBoss RichFaces and Spring Web Flow

Practical RichFaces

January 8th, 2010

As I had mentioned in a previous post, I recently invested in a couple of books on JBoss RichFaces.  Having read and reviewed JBoss RichFaces 3.3 I set about doing the same for the other book, Practical RichFaces.

The book started out giving the same background information on JSF, RichFaces and Ajax4Jsf but in contrast to JBoss RichFaces 3.3 stated that it will not be using JBoss Seam in the example’s which I was happy about.  That is of course not a reflection on JBoss Seam but more my desire to read about RichFaces and not the many technologies that might complement it.

In the second chapter, the book suggests installing JBoss Tools and as I have not used this Eclipse plug-in before I decided I would do just that.  It then proceeds to work through a small example to verify the Eclipse\JBoss Tools installation.  This is done in some detail and would be quite useful if looking at RichFaces for the first time.

Some time is then spent introducing the main RichFaces components that support Ajax functionality, namely <a4j:comandLink>, <a4j:commandButton>, <a4j:support> and <a4j:poll>.  These concepts were covered clearly and concisely with good use of appropriate examples.  The remaining a4j components are covered in the chapter that follows.

Having covered the a4j components the book then proceeds to cover the majority of rich components dividing the coverage into input components, output components, data iteration components, selection components and menu components.  The coverage of the input components is brief which is to be expected as it would be difficult to add anything to the JBoss RichFaces reference documentation.  The coverage of the output components is a little more in-depth than the reference documentation and demonstrates, by example, some nice tips and tricks.  The data iteration components, selection components and menu components are covered in roughly the same level of detail as that provided by the reference documentation.

The Scrollable Data Table and Tree are given a chapter of their own which covers the main functionality and usage of these components.  As with JBoss RichFaces 3.3 I was disappointed with the level of coverage the Tree component received.  This is one of the more complicated components and I would like to have seen more examples of its usage.

The last chapter on skinning is on a par with JBoss RichFaces 3.3 and covers the subject well.

My overall impression was again that I’m not really sure that this book adds anything to the freely available reference documentation but the tutorial style is certainly easier to read.  I would recommend this book for someone starting out with RichFaces or for someone wanting to read a book end-to-end to get up to speed quickly.  What is really needed for RichFaces is a RichFaces Recipe’s Book which is packed full of real world examples of using rich faces beyond the simple examples available on the RichFaces demo website.

One last comment that I would make on the book is that it got me wondering about the level of proof reading of these books.  There are a number of glaring errors that would have been noticed if reviewed by anyone with RichFaces knowledge who reads this book.  I think these types of mistakes should not make their way to print.

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

JBoss Rich Faces 3.3

December 16th, 2009

I have been developing with JBoss Rich Faces for a couple of years now and recently I decided to invest in a couple of books on the subject to try and obtain a better (more rounded) understanding of the framework.  When purchasing books related to frameworks that already have good reference documentation I’m always sceptical that the book will provide additional insight above and beyond the freely available references.

One of the books I purchased was ‘JBoss Rich Faces 3.3′ which I set about reading from cover to cover.  As with many of these books, it builds a sample application to demonstrate the use of the framework in a ‘real world’ application.  In this instance, an advanced contact manager is developed.

The development of the application is demonstrated using Seam, Facelets, Hibernate JPA and Hibernate Validator which may or may not be desirable for the reader.  I personally have no immediate interest in Seam and I found the level of content dedicated to Seam to be excessive.  There are a number of books available on Seam and I would have purchased one of those had I wanted to read about Seam.  I have used Hibernate JPA extensively and given that JPA is a standardised API it’s inclusion in the examples is welcome (it makes for more realistic examples).

The demonstration application used the AJAX components of Rich Faces extensively and this was one of the areas I wanted to focus on.  Each of the AJAX components is discussed in the context of the contact manager application as well as smaller examples.  This does a good job of relaying the key characteristics of the component and its attributes.  In particular, the book does a reasonably good job of describing how the AJAX support components interact with the JSF lifecycle.

One thing that I would have liked to have seen was a significant working example of using the RichFaces tree components in conjunction with JPA entities.  I have been toiling over this myself for some time now.

I’m not really sure that this book add’s anything to the freely available reference documentation but the tutorial style is certainly easier to read, particularly if you want to get up to speed quickly.  Reading the reference documentation end-to-end would be as tedious as watching channel 4’s Big Brother dominated summer programming.


1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 4.00 out of 10)
Loading ... Loading ...