protected Object convertValue(String[] value) {
// we can ignore passed in value, but what we do instead is create an
object based on child components
LocalTime time=(LocalTime)timepicker.getconvertedinput();
DateTime datetime=time.withDate
((LocalDate)datepicker.getConvertedInput());
return datetime;
}
Yeah, this was the direction I've been thinking as well. What I didn't
like about this is that the String[] argument is passed in - even
though it can't be ignored it just doesn't look great, and like you
say...
you have to do a bit of extra chicking still because validatation hasnt yet
passed on the date and time pickers, only coversion. this can be improved
imho. we can do conversion+validation sequentially in a single pass instead
of in multiple separate passes.
it's only half way done. Imho, even would be even cooler if model
updating would have been done for those kids as well, so that I don't
have to know about converted input (imo an internal method) but can
just get the model objects directly.
Which makes me think of something... what should we do if anything
fails (conversion, validation) for child components. You typically
want to process siblings like we've always done for formcomponents
that are not nested in other formcomponents, but I don't think we
should visit deeper (go up the hierarchy as we traverse post order)
for any of the steps (conversion, validation and updatemodel) when one
of them fails. WDYT?
i can probably make this change soon.
Excellent! :)
Eelco