-
1. Re: <rich:calendar> validation for current date and future date
iabughosh Sep 20, 2011 8:32 AM (in response to swastikpadhy84)1 of 1 people found this helpfulHi swastik,
you can use @Future for future date, and for your start/end date validation you can use rich:graphValidator ex:
<rich:graphValidator value=""#{yourBean}>
<rich:calendar id="startDate" value="#{yourBean.startDate}"/>
<rich:calendar id="endDate" value="#{yourBean.endDate}"/>
</rich:graphValidator>
in yourBean :
@AssertTrue(message="date is valid")
public boolean isDateValid() {
return endDate.after(startDate);
}
-
2. Re: <rich:calendar> validation for current date and future date
swastikpadhy84 Sep 21, 2011 3:58 AM (in response to iabughosh)HI Ibrahim,
Thanks for your quick response. I tried to use @Future in my bean field, but its taking only future date and when I put current date, its giving error.
Is there anything for current date ??
Thanks & Regards,
Swastik
-
3. Re: <rich:calendar> validation for current date and future date
iabughosh Sep 22, 2011 7:12 PM (in response to swastikpadhy84)mmm, @Future takes only the date after, so if you put the current date it will not pass the validation, @Past passes the current date but it will not work in your case, so i suggest you to make your own current date validation annotaion .
ragards.