This content has been marked as final.
Show 3 replies
-
1. Re: get value of rich:calendar for validation
alexsmirnov Jul 17, 2009 5:50 PM (in response to jmaglio)That is common JSF issue - multi-field navigation is very hard to implement.
At the PROCESS_VALIDATORS phase 'value' attribute not yet assigned, therefore you get invalid date for a 'startDate' component.
You should use value argument from validate method call for the both dates. Suggested implementation is:<rich:calendar id="fromDate" validator="#{bean.checkFromDate}" /> <rich:calendar id="toDate" validator="#{bean.checkToDate}"> </rich:calendar>
The bean should be request scope and 'checkFromDate' does nothing but store submitted date into a some field.
in the 'checkToDate' method you can compare both values and throw validation exception for incorrect order. -
2. Re: get value of rich:calendar for validation
nbelaevski Jul 18, 2009 7:54 AM (in response to jmaglio)I guess the problem is
Date startDate = (Date) date.getData();
-
3. Re: get value of rich:calendar for validation
jmaglio Jul 22, 2009 2:10 PM (in response to jmaglio)Thanks, Alex. That worked!