[ 
https://issues.apache.org/jira/browse/WICKET-5902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14535416#comment-14535416
 ] 

Sven Meier commented on WICKET-5902:
------------------------------------

Hi Guillaume,

well, the pattern probably identifies the message you want to show, e.g. 
"[0-9]+" -> "Please enter a whole number".
I the pattern changes, you'll probably have to change the message too anyway.

If you use xml properties, the special characters will be no problem.

You know that you can use component specific messages, do you? e.g. 
"componentId.PatternValidator=Please enter foo"?



> Allow to easily override the error key of a PatternValidator
> ------------------------------------------------------------
>
>                 Key: WICKET-5902
>                 URL: https://issues.apache.org/jira/browse/WICKET-5902
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: Guillaume Smet
>            Priority: Minor
>
> By default, PatternValidor builds its error message by including the pattern, 
> which might be a complicated regexp.
> In our applications, we often override the error message key to provide a 
> user-compliant error message.
> We currently do it by overriding decorate() but it would be simpler with a 
> setter on PatternValidator.
> PR to come.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to