yeah we should add support that you can throw an ConversionException with
the preferred key already set in it.

can you add a feature request for this in jira?

johan



On 12/13/06, Koen Molkenboer <[EMAIL PROTECTED]> wrote:


If you are creating a custom converter in wicket 2.0, you just implement
the
IConverter interface, use the converter in your formcomponent, etc.

When the form is submitted the
wicket.markup.html.form.FormComponent#convert() method will be called. If
you configurated your custom converter the right way, the
convertToObject()
method on your custom converter will be called. In this method you should
throw a ConversionException if the converter cannot convert the input to
the
specified type. When this exception is thrown it will be caught in the
wicket.markup.html.form.FormComponent#convert() method, a validation error
is created with message key 'TypeValidator' or 'TypeValidator.classname'.

I would like to have the possibility to assign to custom message key to
that
validation error. Because there are situations that you have different
converters which converts a String to (for example) a Double with
different
error messages.


--
View this message in context:
http://www.nabble.com/Custom-converter-and-custom-error-message-wicket-2.0-tf2813302.html#a7850871
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Reply via email to