[
https://issues.apache.org/jira/browse/WICKET-1654?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Igor Vaynberg updated WICKET-1654:
----------------------------------
Fix Version/s: 1.5-M1
this wont affect the interface. this feature request is to be able to provide
an imodel that constructs the entire message instead of always going through
resource keys - so it is up to ivalidator implementations to do this.
> Update validators to accept IModel parameter for easy override of error
> messages
> --------------------------------------------------------------------------------
>
> Key: WICKET-1654
> URL: https://issues.apache.org/jira/browse/WICKET-1654
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-M1
> Environment: N/A
> Reporter: Will Hoover
> Assignee: Igor Vaynberg
> Priority: Minor
> Fix For: 1.5-M1
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Update validators to accept IModel parameter for easy override of error
> messages. Instead of looking up the resource key in "Application.properties"
> and adding to the components properties file, allow a model to be passed into
> the validators that will override the default validation error message. For
> example:
> StringResourceModel srm = new
> StringResourceModel("my.custom.stringvalidator.message", null);
> add(new TextField("fname").setLabel(new Model("first
> name")).add(StringValidator.minimum(5, srm));
> 1) This will also allow someone to pass in parameters that they want
> displayed along with the validation error message (difficult to accomplish
> when just overriding the resource key- where to pass?)
> 2) More intuitive because it uses the same concept that is applied to
> components... i.e. new TextField("id", new Model(...)) VS
> StringValidator.minimum(5, new Model(...))
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.