Tag Name: | af:validateDateRestriction> |
Type: | oracle.adf.rich.DateRestriction |
Validate that the date is valid with some given restrictions.
This validator provides hints for the help framework, which cannot be turned off.
This validator also runs on the client (implements org.apache.myfaces.trinidad.validator.ClientValidator).
This is an example of how to create a custom error message:
<af:validateDateRestriction messageDetailInvalidDaysOfWeek="You entered {1}, which is on a {2}" invalidDaysOfWeek="Mon"/>
<af:inputDate id="days" value="#{bean.date}" label="Select a date, but check possible holidays first"> <af:convertDateTime pattern="yyyy-MM-dd"/> <af:validateDateRestriction invalidDays="#{bean.date.nationalHolidays}" /> </af:inputDate> <af:inputDate id="month" value="#{bean.date}" label="Select a date, but not within November or December"> <af:convertDateTime pattern="yyyy-MM-dd"/> <af:validateDateRestriction invalidMonths="Nov Dec" /> </af:inputDate> <af:inputDate id="daysOfWeek" value="#{bean.date}" label="Select a date, but not a Monday"> <af:convertDateTime pattern="yyyy-MM-dd"/> <af:validateDateRestriction invalidDaysOfWeek="Mon"/> </af:inputDate>
Name | Type | Supports EL? | Description |
---|---|---|---|
disabled | boolean | Yes | Default Value: false Whether the validator should be disabled, default to false. |
hintInvalidDaysOfWeek | String | Yes |
Hint message to be used, when giving a hint on the not allowed weekdays. Parameters:
|
hintInvalidMonths | String | Yes |
Hint message to be used, when giving a hint on the not allowed months. Parameters:
|
invalidDays | org.apache.myfaces.trinidad.model.DateListProvider | Yes | To specify a concrete List of Dates, use the invalidDays attribute and wire it to a DateListProvider implementation. This returns a list of dates, which are invalid. |
invalidDaysOfWeek | String[] | Yes | Specify the weekdays which are invalid for your use case. The attribute takes whitespace delimited list of weekdays. Possible values are sun, mon, tue, wed, thu, fri, sat. |
invalidMonths | String[] | Yes | Specify the month which are invalid for your use case. The attribute takes a whitespace delimited list of months. Possible values are jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec. |
messageDetailInvalidDays | String | Yes |
The detail error message to be used for constructing faces messages, when input value is less than the set invalidDate value. Parameters:
|
messageDetailInvalidDaysOfWeek | String | Yes |
The detail error message to be used for constructing faces messages, when input value is less than the set invalidDaysOfWeek value. Parameters:
|
messageDetailInvalidMonths | String | Yes |
The detail error message to be used for constructing faces messages, when input value exceeds the invalidMonths value set. Parameters:
|