PhotoAlbum Application Download Support Developer Guide
Skins:
Resources/Beans Handling
Ajax Miscellaneous
Usage
Tag Information

Graph validator component also allows to register Hibernate Validators for the input components. As opposite to beanValidator that should be a child component for the input to be validated this component should wrap some subtree with inputs. As a result validator for every input in this subtree will be added to the component.

Look through the next simple example:

Title
User Info:
Name:
Email:
Age:


View Source


Validation Bean Code

There is one additional useful feature in Graph Validator component. Value attribute could be defined with some value binding to bean. And the bean properties will be validated again after model update.

Simple example of such kind of usage is shown below. Just write some activities of the day and the time you spend on each one in a day.

Title
Activity Time
Sport
Entertainment
Sleeping
Games


View Source

In this case only properties of each passTime(values of the inputs) is validated at validation phase. But after the model is updated (Each explicit passtime was validated ok) all the properties including "TotalTime" are validated again. And total validation could fail if the sum of the hours in a day more than 24.

RichFaces Wiki RichFaces Project Site