When the validation triggered in FormComponent.convertInput() fails, a ValidationError is reported. This ValidationError provides variable substitution for the error message. If you write your own implementation of IConverter and have control over the creation of a ConversionException, you can easily add custom variables to it, which then can be used for substitution. But in case you use one of the implementations provided by wicket, you can't add variables to the ConversionException.
So I propose to add the possibility to modify the ValidationError object, so a FormComponent can append its own variables to it, or even overwrite values, add new message keys, ..
I'll attach a patch - just need to figure out how I made a little refactoring and introduced a new method FormComponent.newValidationError(). It encapsulates the creation of the ValidationError and can be overwritten. It also reduces some duplicate lines of code.
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Assignee||Martin Grigorov [ mgrigorov ]|
|Fix Version/s||6.3.0 [ 12323327 ]|
|Resolution||Fixed [ 1 ]|
|Transition||Time In Source Status||Execution Times||Last Executer||Last Execution Date|
|4d 16h 46m||1||Martin Grigorov||15/Nov/12 08:48|