This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes JSF and the fly likes Problems validating rich:calendar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Problems validating rich:calendar" Watch "Problems validating rich:calendar" New topic

Problems validating rich:calendar

Radu Mircea
Ranch Hand

Joined: Jun 14, 2009
Posts: 45
Hi !

I am trying to validate a rich:calendar for not null input using <rich:beanValidator />, but i am not able to validate for null inputs.

For example in my constraits.xml file, i validate getter for calendar:

<getter name="dateOfBirth">

<constraint annotation="javax.validation.constraints.Past"/> (works fine)

<constraint annotation="javax.validation.constraints.NotNull" /> (not work)

<constraintannotation="org.hibernate.validator.constraints.NotEmpty"/> (not work)


Those last two constraint did not worked because "DateTime" data type dose not recognize them ? (first of them as far as i know is used for numeric values and second one for strings).

There is such a constraint for date time data type ? Could i validate somehow using constraints written in xml file for not null inputs ?

I am forced to used required="true" in xhtml for this kind of validation (not null) for rich:calendar (if i am using hibernate validator) ?

Please if you have an idea help me...

rocket mass heater kickstarter
subject: Problems validating rich:calendar