You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Sebastian Dimunzio <sd...@gmail.com> on 2005/11/04 15:36:50 UTC

custom error message

Hi!
Somebody know the way to show a custom error message for each field on my
form, for example "You must fill the first name"

Thanks!

Saludos
Sebastian Dimunzio

Re: custom error message

Posted by Mike Kienenberger <mk...@gmail.com>.
Sebastian, h:message2 is not a real component yet.   It's just
something that usrwagner was proposing.

There's no easy solution to what you're asking for yet.
JSF 1.2 has added a requiredMessage attribute that would do what you want.

https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=81

h:message2 could in theory cycle through the list of messages and
replace certain messages with a custom one.   However, it'd be very
hard to determine which message was the one you wanted to replace.

On 11/4/05, Sebastian Dimunzio <sd...@gmail.com> wrote:
>
>
> Thanks! you
>
>
> 2005/11/4, urswagner@bluemail.ch <ur...@bluemail.ch>:
> >
> > What I have forgotten
> > The specification should be like this
> >
> > <h:message2 style="color:red" for="firstname"
> >           value="You must fill the first name"/>
> >
> >
> > >-- Original-Nachricht --
> > >Reply-To: "MyFaces Discussion" <users@myfaces.apache.org >
> > >Date: Fri, 4 Nov 2005 15:46:26 +0100
> > >From: urswagner@bluemail.ch
> > >Subject: RE: custom error message
> > >To: "MyFaces Discussion" < users@myfaces.apache.org>
> > >
> > >
> > >
> > >I would like to have such a tag component.
> > >
> > >>-- Original-Nachricht --
> > >>Reply-To: "MyFaces Discussion" < users@myfaces.apache.org>
> > >>Date: Fri, 4 Nov 2005 11:36:50 -0300
> > >>From: Sebastian Dimunzio <sd...@gmail.com>
> > >>To: users@myfaces.apache.org
> > >>Subject: custom error message
> > >>
> > >>
> > >>Hi!
> > >>Somebody know the way to show a custom error message for each field on
> > my
> > >>form, for example "You must fill the first name"
> > >>
> > >>Thanks!
> > >>
> > >>Saludos
> > >>Sebastian Dimunzio
> > >
> >
> >
>
>
>
> --
> Sebastian Dimunzio
>

Re: custom error message

Posted by Sebastian Dimunzio <sd...@gmail.com>.
Thanks! you


2005/11/4, urswagner@bluemail.ch <ur...@bluemail.ch>:
>
>
> What I have forgotten
> The specification should be like this
>
> <h:message2 style="color:red" for="firstname"
> value="You must fill the first name"/>
>
>
> >-- Original-Nachricht --
> >Reply-To: "MyFaces Discussion" <us...@myfaces.apache.org>
> >Date: Fri, 4 Nov 2005 15:46:26 +0100
> >From: urswagner@bluemail.ch
> >Subject: RE: custom error message
> >To: "MyFaces Discussion" <us...@myfaces.apache.org>
> >
> >
> >
> >I would like to have such a tag component.
> >
> >>-- Original-Nachricht --
> >>Reply-To: "MyFaces Discussion" <us...@myfaces.apache.org>
> >>Date: Fri, 4 Nov 2005 11:36:50 -0300
> >>From: Sebastian Dimunzio <sd...@gmail.com>
> >>To: users@myfaces.apache.org
> >>Subject: custom error message
> >>
> >>
> >>Hi!
> >>Somebody know the way to show a custom error message for each field on
> my
> >>form, for example "You must fill the first name"
> >>
> >>Thanks!
> >>
> >>Saludos
> >>Sebastian Dimunzio
> >
>
>


--
Sebastian Dimunzio

RE: custom error message

Posted by ur...@bluemail.ch.
What I have forgotten
The specification should be like this

 <h:message2 style="color:red" for="firstname" 
           value="You must fill the first name"/>


>-- Original-Nachricht --
>Reply-To: "MyFaces Discussion" <us...@myfaces.apache.org>
>Date: Fri, 4 Nov 2005 15:46:26 +0100
>From: urswagner@bluemail.ch
>Subject: RE: custom error message
>To: "MyFaces Discussion" <us...@myfaces.apache.org>
>
>
>
>I would like to have such a tag component.
>
>>-- Original-Nachricht --
>>Reply-To: "MyFaces Discussion" <us...@myfaces.apache.org>
>>Date: Fri, 4 Nov 2005 11:36:50 -0300
>>From: Sebastian Dimunzio <sd...@gmail.com>
>>To: users@myfaces.apache.org
>>Subject: custom error message
>>
>>
>>Hi!
>>Somebody know the way to show a custom error message for each field on
my
>>form, for example "You must fill the first name"
>>
>>Thanks!
>>
>>Saludos
>>Sebastian Dimunzio
>


RE: custom error message

Posted by ur...@bluemail.ch.
I would like to have such a tag component.

>-- Original-Nachricht --
>Reply-To: "MyFaces Discussion" <us...@myfaces.apache.org>
>Date: Fri, 4 Nov 2005 11:36:50 -0300
>From: Sebastian Dimunzio <sd...@gmail.com>
>To: users@myfaces.apache.org
>Subject: custom error message
>
>
>Hi!
>Somebody know the way to show a custom error message for each field on my
>form, for example "You must fill the first name"
>
>Thanks!
>
>Saludos
>Sebastian Dimunzio