Calendar: Selecting current date or earlier generates a validation error

Issue: Message component give error: Select a date after –today–. There are two issues here:

  • User should be able to select today without getting a validation error.
  • User should be able to select a date prior to today without getting a validation error if the minDate value is not set.

The first issue is a bug and the second issue is as designed but should be corrected in a future release.

Calendar has a type–safe selectedDate (aliased to value) property. If not set, it is the current date. By default, if minDate and maxDate are not set then minDate is the same as selectedDate and maxDate is 4 years later. The component has a built–in validator that checks for minDate <= selectedDate <= maxDate.

Selecting a date should be orthogonal to validating a date and by default there should be no validation and it should be possible to select any date. An issue has been logged on this so hopefully a fix will become available.


// The workaround for both of these issues is the same. As a best practice, you should always assign the properties, minDate, maxDate to the range you want the user to choose from. You may also want to assign selectedDate so that it is within the range, but that is optional.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo