}
});
rangeDateLabel.setOutputMarkupId(true);
form.add(rangeDateLabel);
rangeDatePicker.add(new AjaxFormSubmitBehavior(form, "onchange") {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target) {
target.add(rangeDateLabel);
}
});
final DatePicker<String> withDropDownDatePicker = new DatePicker<String>("withDropDownDatePicker", withDropDownDateModel);
withDropDownDatePicker.setChangeMonth(true);
withDropDownDatePicker.setChangeYear(true);
withDropDownDatePicker.setYearRange(new DatePickerYearRange(new Short("-20"), new Short("20"), true));
// Label
withDropDownDatePicker.setLabel(Model.of("Year/month dropdown"));
form.add(withDropDownDatePicker);
final Label withDropDownDateLabel = new Label("withDropDownDateLabel", new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return withDropDownDateModel.getObject();
}
});
withDropDownDateLabel.setOutputMarkupId(true);
form.add(withDropDownDateLabel);
withDropDownDatePicker.add(new AjaxFormSubmitBehavior(form, "onchange") {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target) {
target.add(withDropDownDateLabel);