You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Krause, Nico" <ni...@tomtom.com> on 2006/03/23 11:59:18 UTC

avoiding duplicate required validation messages

Hello,
 
I have a form with several input elements with required=true for the
build-in required validation.
I turned global messages on under the form.
 
<h:messages styleClass="errorText" globalOnly="false" />
The thing i don't like is:
When there are more then one orm fields which are'nt filled out. 
i get duplicate validation messages like:
 
* "input field must be filled"
* "input field must be filled"
* "input field must be filled"
* "input field must be filled"
...
 
Does anybody know how to prevent this?
Do i have to make a new renderer for the messages? is that a good idea?
 
Nico
 
 
Nico Krause| Software Development| TomTom WORK | nico.krause@tomtom.com
| +49 (0)1749891949 mobile | +49(0)34124495-0 office | +49(0)34124495-25
fax | www.tomtomwork.com <http://www.tomtomwork.com/> 
 

Re: avoiding duplicate required validation messages

Posted by Mike Kienenberger <mk...@gmail.com>.
If you specify an id for each input component, then each of those
messages will become more meaningful by showing the id for which field
they apply to.

Alternately, you can provide a label component for each field, and use
the t:messages.   The tomahawk version of messages will use the label
instead of the id if the label is specified.

On 3/23/06, Krause, Nico <ni...@tomtom.com> wrote:
>
> Hello,
>
> I have a form with several input elements with required=true for the
> build-in required validation.
> I turned global messages on under the form.
>
> <h:messages styleClass="errorText" globalOnly="false" />
> The thing i don't like is:
> When there are more then one orm fields which are'nt filled out.
> i get duplicate validation messages like:
>
> * "input field must be filled"
>
> * "input field must be filled"
>
> * "input field must be filled"
>
> * "input field must be filled"
> ...
>
> Does anybody know how to prevent this?
> Do i have to make a new renderer for the messages? is that a good idea?
>
> Nico
>
>
>
> Nico Krause| Software Development| TomTom WORK | nico.krause@tomtom.com |
> +49 (0)1749891949 mobile | +49(0)34124495-0 office | +49(0)34124495-25 fax |
> www.tomtomwork.com
>