You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Jorge Vásquez <jv...@3eyegroup.com> on 2006/09/14 02:23:46 UTC

Using personalized validation messages...

Regards to all,

Is there a way to make validators return personalized message Strings that
are not necessarily found in message Bundles?

 

For example, in the following code I would like to be able to specify the
validator to use any message that I wished:

 

            <h:inputText id="regExprValue" value="#{validateForm.regExpr}"
required="true">
                <t:validateRegExpr pattern='\d{5}' />
            </h:inputText>
                 <t:message id="regExprValueError" for="regExprValue"
styleClass="error" />
 
But unfortunately, in this case the tag validateRegExpr only has the pattern
attribute.
  
Note:  In the past I have used the method of creating a message String in a
messageBundle with the same Id as the one used by the component but in this
case we are not using messageBundles as internationalization strategy for
our project.
 
Any ideas?
 
Thanks,
Jorge Vásquez

 


Re: Donwload war sandbox

Posted by Gerald Müllan <bi...@gmail.com>.
Hi,

in order to get sandbox .jar, you can also download it from the
nightlies section:

http://people.apache.org/builds/myfaces/nightly

cheers,

Gerald

On 9/14/06, Wdiaz <wd...@unipamplona.edu.co> wrote:
> Where i can download the war of Sandbox to obtain the jar?
>
> --
> Cordialmente
>
> William Diaz Pabón
> Coordinador Técnico de Desarrollo
> Vicerrectoría de Gestión y Desarrollo Tecnológico
> Universidad de Pamplona
>
>


-- 
http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Donwload war sandbox

Posted by Wdiaz <wd...@unipamplona.edu.co>.
Where i can download the war of Sandbox to obtain the jar?

-- 
Cordialmente

William Diaz Pabón
Coordinador Técnico de Desarrollo
Vicerrectoría de Gestión y Desarrollo Tecnológico
Universidad de Pamplona


RE: Using personalized validation messages...

Posted by Jorge Vásquez <jv...@3eyegroup.com>.
Thanks a lot Mike, it worked perfect!!!
Regards,
JV 

-----Mensaje original-----
De: Mike Kienenberger [mailto:mkienenb@gmail.com] 
Enviado el: miércoles, 13 de septiembre de 2006 20:26
Para: MyFaces Discussion
Asunto: Re: Using personalized validation messages...

I added a message attribute to all of the tomahawk validators.

<t:validateRegExpr pattern='\d{5}' message='No, really, dude, you
gotta put in a standard US zip code, ya know?'  />

should work.


On 9/13/06, Jorge Vásquez <jv...@3eyegroup.com> wrote:
>
>
>
>
> Regards to all,
>
> Is there a way to make validators return personalized message Strings that
> are not necessarily found in message Bundles?
>
>
>
> For example, in the following code I would like to be able to specify the
> validator to use any message that I wished:
>
>               <h:inputText id="regExprValue"
value="#{validateForm.regExpr}"
> required="true">
>                 <t:validateRegExpr pattern='\d{5}' />
>             </h:inputText>
>                  <t:message id="regExprValueError" for="regExprValue"
> styleClass="error" />
>
> But unfortunately, in this case the tag validateRegExpr only has the
pattern
> attribute.
>
> Note:  In the past I have used the method of creating a message String in
a
> messageBundle with the same Id as the one used by the component but in
this
> case we are not using messageBundles as internationalization strategy for
> our project.
>
> Any ideas?
>
> Thanks,
> Jorge Vásquez
>
>
>


Re: Using personalized validation messages...

Posted by Mike Kienenberger <mk...@gmail.com>.
I added a message attribute to all of the tomahawk validators.

<t:validateRegExpr pattern='\d{5}' message='No, really, dude, you
gotta put in a standard US zip code, ya know?'  />

should work.


On 9/13/06, Jorge Vásquez <jv...@3eyegroup.com> wrote:
>
>
>
>
> Regards to all,
>
> Is there a way to make validators return personalized message Strings that
> are not necessarily found in message Bundles?
>
>
>
> For example, in the following code I would like to be able to specify the
> validator to use any message that I wished:
>
>               <h:inputText id="regExprValue" value="#{validateForm.regExpr}"
> required="true">
>                 <t:validateRegExpr pattern='\d{5}' />
>             </h:inputText>
>                  <t:message id="regExprValueError" for="regExprValue"
> styleClass="error" />
>
> But unfortunately, in this case the tag validateRegExpr only has the pattern
> attribute.
>
> Note:  In the past I have used the method of creating a message String in a
> messageBundle with the same Id as the one used by the component but in this
> case we are not using messageBundles as internationalization strategy for
> our project.
>
> Any ideas?
>
> Thanks,
> Jorge Vásquez
>
>
>