Hello,
I'm integrating DatePicker into a form I'm developing and I'm encountering the following issues:
1) I can't set the 'name' attribute of the DateBox. I looked at the source and you have a protected method to access the box, but I believe this should either be public or the setName() attribute should be exposed. Without setName(), the form widget cannot POST properly. So far, I am working around this by directly setting the 'name' attribute on the element. I'm trying to add a keyUpHandler() to the DateBox for the purpose of validating a Date as the user types the date, and the same problem gets in my way.
2) I'd like to be able to control the enabled dates programmatically. Something like:
dateBox.setDateEnabledFilter
(new DateEnabledFilter()
{
@Override
public List<Date> getDisabledDates(Date startDate, Date endDate) {
// return a list of dates that are disabled or an empty list id none are enabled
}
}
);
I realise that a more simple version of this API would be to simply have a single method that returns a boolean for a particular date, but typically the date widget displays a batch of dates all at the same time, and the enabled or disabled dates may have to await an RPC callback linking to a server-side holiday calendar, so the batch approach is probably more performant for this use-case.
I also realise that there is a setStartDate() and setEndDate() methods to assist with this type of logic, but being able to selectively render at a granular date level is much better overall.
Any thoughts are welcome.
Thanks,
Chris