You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (JIRA)" <ji...@apache.org> on 2010/09/10 06:48:09 UTC

[jira] Updated: (WICKET-1654) Update validators to accept IModel parameter for easy override of error messages

     [ 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-M3
                       (was: 1.5-M2)

> 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-M3
>
>   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.