Hey Wolfgang!

Glad to have helped somewhat ;-)

Using an empty string helps, but the root 'problem' regarding the message
attributes is this though:

The tag should not use the summary entry as detail entry if it can't find
the detail, and vice versa. Doing this, one always has to deactivate either
the detail or summary, if one message on the current page does not have a
detail or summary, or you will get message lines that seem to specify a
message twice...

Greetings,
Kris

-----Original Message-----
From: Wolfgang Schreiner [mailto:[EMAIL PROTECTED] 
Sent: woensdag 13 juli 2005 11:58
To: MyFaces Discussion
Subject: Re: incorrect display of error message

hi kris,

thanks a lot for the hint. i'll try out, but it already works fine with 
the solution from the other posting (and saves come code ;)).


--
best regards,

Wolfgang




Kris Verhoye schrieb:

>Hi Wolfgang,
>
>I have had the same problem regarding error messages. In my case it
>displayed every error twice in the messages list as well, using the
>h:messages tag. I'm now using this combo and that seems to work:
>
><h:messages globalOnly="true" styleClass="errors"/>          
><h:message for="loginInput" styleClass="errors"/>
>
>Whenever I use the globalOnly attribute (set to true) for the messages tag,
>it displays my messages only once. If I don't do that, it will display them
>twice (I don't know why though).
>
>As for the message tag: the fact that it displays the entry twice on one
>line is similar to having set the showDetail attribute of the h:message tag
>to true, which is the default. Try setting it to false, or specify an entry
>in your resource bundle in order to see if the system is using your primary
>entry as detail entry;
>
>For ex:
>
>Login_error=invalid username/password
>Login_error_detail=Please specify your correct login and password
>
>If the system can't find a detail entry, I noted that it will use the
>primary entry as detail.
>
>I hope this helps,
>Kris
>
>-----Original Message-----
>From: Wolfgang Schreiner [mailto:[EMAIL PROTECTED] 
>Sent: woensdag 13 juli 2005 10:52
>To: MyFaces Discussion
>Subject: incorrect display of error message
>
>hi,
>
>i would like to perform some validation checks on my web application. it 
>works but always displays the error message twice
>
>my jsp code:
>            <h:commandButton value="#{msg.button_value}" 
>action="#{login.login}"/>
>            <h:outputText id="loginError" binding="#{login.component}" />
>            <h:message for="loginError" style="color:red" 
>showSummary="true" />
>
>and the snippet from the login backing bean:
>            context.addMessage(
>                this.component.getClientId(context),
>                new FacesMessage(bundle.getString("invalid_login"))
>            );
>
>the output for the loginError component is always "invalid 
>username/password invalid username/password"
>anyone encountered similar problems?
>
>  
>


Reply via email to