I'm not sure that adding a validDays attribute is a very workable
solution. What happens if there is an overlap with the valid and
invalid days? Right now, the same thing could be accomplished by
putting all of the dates in the date range in the invalidDays list and
removing the first day of the month.

I haven't used the validateDateRestriction tag personally, but unless
it prevents the user from selecting the dates in the invalidDates
list, you probably shouldn't use it for use case because it would be a
bad UI design to allow the user to select a date that is invalid.

If you want to make an enhancement request to the component, you
should file a Jira issue. Suggestions on an email list will most
likely be ignored.

-Richard


On Tue, Dec 22, 2009 at 11:30 AM,  <[email protected]> wrote:
> That sounds good.
>
> Also May be we can suggest trinidad to have another attribute called
> "validDays" for the tr:validateDateRestriction component like the following:
>
>  <tr:inputDate id="days" value="#{bean.date}"
>                                   label="Select a date">
> <tr:convertDateTime pattern="yyyy-MM-dd"/>
> <tr:validateDateRestriction  validDays="#{bean.date.allowableDates}" />
> </tr:inputDate>
>
> -------------- Original message from Richard Yee <[email protected]>:
> --------------
>
>
>> If you are going to limit the date selection to the first day of the
>> month within a date range, you are probably better off just to use a
>> selectOneChoice with a selectItem for each month that is within the date
>> range. The inputDate does not provide much benefit here since there is
>> only one date per month that can be chosen.
>>
>> -Richard
>>
>> [email protected] wrote:
>> > Hi,
>> > with the following code, I don't think it suits my need. Please
>> > advise if there is way to achieve only allowing 1st day of each month
>> > within a certain range, say within Oct 15, 2008 - Oct 30, 2010 to be
>> > selectable. If this is not possible, backend validation is the only
>> > choice.
>> >
>> > > > label="Select a date, but check
>> > possible holidays first">
>> >
>> > > > invalidDays="#{bean.date.nationalHolidays}" />
>> >
>>

Reply via email to