How to handle conversion error in DateField

Hi,

I have some problems using the DateField. If the user enters an invalid datestring in the textbox of the DateField, an ConversionException is thrown and a “!” with the exception tooltip is rendered to the caption of the Datefield.

But this errorindicator still remains even if the user enters a valid datestring or selects a date from the popup.

what is the preferred way to handle this error.

I know i can add an errorHandler to the datefield, and i can subclass the datefield and override the handleUnparsableDateString method.

what do i have to do to :
1.) Display a userreadable error message in the component
2.) delete the errormessage if a valid date is entered
3.) I think this is not possible: display the wrong entered value in the textfield of the datefield

One last question: How can you controll the dateformat of the component. is setting the locale the only way doing this ?

thanks
Jan

Use
DateField.setDateFormat(String)
, that should do it.

Cool, this works.