Hi!

I checked it again, and that's my h:messages tag I use in the JSF page where
the problem occurs:


<h:messages layout="table" globalOnly="false" showSummary="true"
      showDetail="false" errorClass="error" fatalClass="error" />


I could reproduce the error ('Validierungsfehler' printed twice) with the
following scenario:

I entered the number '0' in the following inputText, which has a
f:validateLongRange child element:
(it also happens if I enter other illegal values like '-1')


<t:column>
          <t:checkbox for="Antwortanzahl" index="0" />
          <t:inputText id="min_Antwortanzahl"
            binding="#{MehrfAuswFrageBacking.inputTextAnzahlAntwortenMin}"
            value="#{MehrfAuswFrageBacking.mehrfAuswFrage.minanzahl}"
            required="false"
            readonly="false"
            disabled="false"
            maxlength="2"
            size="2"
            title="Textfeld zur Eingabe der min. Antwortanzahl"
            immediate="false">
            <f:validateLongRange minimum="1" maximum="99" />
          </t:inputText>
          <h:outputText escape="false"
            value="&nbsp;(1 bis 99)"
            styleClass="formText"
            lang="de"
            title="Zahlenbereich ist 1 bis 99" />
          <f:verbatim><br/></f:verbatim>
          <h:message for="min_Antwortanzahl"
            styleClass="error"
            lang="de"
            title="Fehlermeldung für das Textfeld zur Eingabe der min.
              Antwortanzahl" />
 </t:column>



This is the commandButton for submitting the page (immediate="false"):
---------------------------------------------------------------------

<h:commandButton value="Speichern"
          action="#{MehrfAuswFrageBacking.save}"
          styleClass="button"
          lang="de"
          title="Speichern und zurück zum Fragen Formular"
          immediate="false" />




Regards,

Matthias

> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Auftrag
> von Simon Kitching
> Gesendet: Dienstag, 3. Januar 2006 22:20
> An: MyFaces Discussion
> Betreff: Re: AW: messages outputs one error message summary many times
>
>
> Hi Matthias,
>
> A FacesMessage object has both a "summary" and "detail". Perhaps both
> are being set to the same string and you are showing both, resulting in
> the same message appearing twice?
>
> Regards,
>
> Simon
>
> Matthias Kahlau wrote:
> > Hi!
> >
> > Did anybody else discover the behaviour of h:messages described below? I
> > can't imagine that I've done sth. wrong, but please correct me
> if I'm wrong.
> > There's only one h:messages tag in my JSF page, and when one
> error occurs,
> > the same error message is printed multiple times (2 to x
> times). Is there a
> > way to prevent this?
> >
> >
> > Regards,
> >
> > Matthias
> >
> >> -----Ursprüngliche Nachricht-----
> >> Von: [EMAIL PROTECTED]
> >> [mailto:[EMAIL PROTECTED] Auftrag
> >> von Matthias Kahlau
> >> Gesendet: Sonntag, 1. Januar 2006 22:09
> >> An: Users MyFaces
> >> Betreff: h:messages outputs one error message summary many times
> >>
> >>
> >> Hi all!
> >>
> >>
> >> I have a problem with the h:messages tag. When an error
> occurs, e. g. an
> >> validation error of f:validateLongRange, because the user entered
> >> an illegal
> >> value (a value not contained in the range defined), the error
> summary is
> >> printed many times in the h:messages tag. I use the tag the
> following way:
> >>
> >> <h:messages layout="table" globalOnly="false" showSummary="true"
> >>       showDetail="false" errorClass="error" fatalClass="error" />
> >>
> >>
> >> When I explicitely add an error message for a specific component to the
> >> FacesContext, I haven't observed that behaviour - the error message is
> >> printed only one time.
> >>
> >>
> >> Regards,
> >>
> >> Matthias
> >>
> >
> >
> >
>

Reply via email to