You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Benedikt Schlegel (JIRA)" <ji...@apache.org> on 2012/11/10 17:07:12 UTC
[jira] [Updated] (WICKET-4863) Customize ValidationError creation
by FormComponent
[ https://issues.apache.org/jira/browse/WICKET-4863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benedikt Schlegel updated WICKET-4863:
--------------------------------------
Attachment: FormComponent.newValidationError.patch
> Customize ValidationError creation by FormComponent
> ---------------------------------------------------
>
> Key: WICKET-4863
> URL: https://issues.apache.org/jira/browse/WICKET-4863
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 6.2.0
> Reporter: Benedikt Schlegel
> Priority: Minor
> Attachments: FormComponent.newValidationError.patch
>
>
> 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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira