File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Rich Faces calendar Date range Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Rich Faces calendar Date range" Watch "Rich Faces calendar Date range" New topic

Rich Faces calendar Date range

nitin pokhriyal
Ranch Hand

Joined: May 19, 2005
Posts: 263

I am facing issue in JSf. I want user to select only dates in the specified range. Say between "1/1/2009" to "1/21/2009" other than that all shd not be selectable. I tried many things it is not working. I am using RichFaces components. If anybody has any idea help me out. Thanks in advance

Tom Fulton
Ranch Hand

Joined: Mar 30, 2006
Posts: 96
I quickly looked at the RichFaces documentation (which is entertaining all by itself) and didn't see a direct way to accomplish what you want to do. If I understand your requirement correctly, you want to limit the available dates to a certain range in the control itself. It does have two attributes you can specify: preloadDateRangeBegin and preloadDateRangeEnd, which would theoretically do what you want. But the documentation (for want of a better word) doesn't say that it actually limits the user's choice, only that it limits the initial range to the specified dates...the implication being that the user can scroll beyond those dates if needed.

You can try to use these attributes, and then add a validator to the control which will determine whether the submitted value is within the range you want.
I agree. Here's the link:
subject: Rich Faces calendar Date range
It's not a secret anymore!