This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSF and the fly likes Group Validations inside data table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Group Validations inside data table" Watch "Group Validations inside data table" New topic
Author

Group Validations inside data table

vaithee sub
Greenhorn

Joined: Mar 12, 2004
Posts: 20
How do I perform Group Validations in h:datatable using custom Validators
For instance lets say I have a data table containing one column containing values of States (NY,NJ...).
In my custom Validator, I want to ensure that the state code does not repeat in any of the rows.

In the validator how do I get the ids for all the state codes to find the value in each of the component?

<h:dataTable id="tableEx1" value="#{careerDisplayBean.stateBarAdmissions}"
var="varstateBarAdmissions">
<h:column>
<h:inputText value="varstateBarAdmissions.stateCode" id="cd">
<h:validator validatorID="stateCodeValidator"/>
</h:inputText
</h:column
</h:dataTable
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Group Validations inside data table