this is already possible, and is very elegant!
all you have to do is something like this
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;
}
and voila, validators and model is now populated with the datetime object
which is constructed from timepicker and datepicker child components.
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. i can probably make this change soon.
-igor
On 4/30/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
Hi,
I have an interesting issue to be solved, which is the fact that the
way our form(component) processing currently works pressumes that all
form components get their input from request parameters. But a
component like DateTimeField (or any FormComponentPanel probably)
doesn't work like that, as it's nested children receive the actual
input, and DateTimeField just combines that.
However, it's a bit of a pitty that it's not possible (or more
preceise, it's a noop) to add say a DateValidator to DateTimeField. I
can think of various hacks, including very specific ones for the
DateTimeField, but so far nothing I really like.
Can anyone think of an elegant, generic way that components such as
DateTimeField can work nicely together with validators (and elegant
imo is *not* passing validators to e.g. the date field, ignoring the
time fields). It's quite an ugly limitation, so any ideas are more
than welcome.
Eelco