I'm using DateField with the beautiful YUI DatePicker in a form with a
ComponentFeedbackPanel associated to each field. To my surprise, the
date validation errors are not being shown in the corresponding panel.
By browsing the classes I came across:
@Override
protected void onBeforeRender()
{
if (dateField == null)
{
// intiailize datefield and datepicker
PropertyModel<Date> dateFieldModel = new
PropertyModel<Date>(this, "date");
add(dateField = newDateTextField("date", dateFieldModel));
dateField.add(newDatePicker());
}
...
What about those hardcoded "date" IDs?
I'm adding the DateField like this:
add(new DateField(FORM_FIELD_BIRTHDAY, new PropertyModel<Date>(
aPerson, FORM_FIELD_BIRTHDAY)).add(
DateValidator.maximum(new
Date())).setRequired(true));
and the ComponentFeedbackPanel:
add(new ComponentFeedbackPanel(fc.getId() + FORM_FEEDBACK, fc)
.setOutputMarkupId(true));
I've added a DateValidator.maximum(new Date())) and this message is shown OK.
The error jetty complains about is:
WARN - WebSession - Component-targetted feedback
message was left unrendered. This could be because you are missing a
FeedbackPanel on the page. Message: [FeedbackMessage message = "Field
'date' is required.", reporter = date, level = ERROR]
Thanks in advance,
Maxi
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]