You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by L Frohman <lf...@gmail.com> on 2006/04/14 22:03:19 UTC

different regex validator error messages

Is there a way I can have different error messages for two different
fields that use the tomahawk regex validator?

<h:inputText id="field1" value="#{myBean.field1}">
   <t:validateRegExpr pattern="xxxxx" />
</h:inputSecret>

error message="you have entered an invalid field1"



<h:inputText id="field2" value="#{myBean.field2}">
   <t:validateRegExpr pattern="yyyyy" />
</h:inputSecret>

error message="field2 must be yada yada yada"

Thanks,
Lance


Re: different regex validator error messages

Posted by Mike Kienenberger <mk...@gmail.com>.
On 4/14/06, L Frohman <lf...@gmail.com> wrote:
> Is there a way I can have different error messages for two different
> fields that use the tomahawk regex validator?

Yes, the latest tomahawk snapshot supports the "message" attribute on
all tomahawk and sandbox validators.

<t:validateRegExpr pattern="yyyyy" message="field2 must be yada yada yada" />

I think I added the feature two or three weeks ago.   You'd have to
check the JIRA issue to find out when for sure.  "message" is a
message key, but I think in the absence of finding the message key in
your message properties file, it'll output the text.