Hi Wolf,

try:
ctx.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR,"Test
Summary","Test" ));

<h:messages ... should go inside the form.
you could put showSummary="true" in the <h:messages ... (if this isn't the
default)

you can put your logging level at debug to get alot more information on what
is
going wrong. 


-----Message d'origine-----
De : Wolf Benz [mailto:[EMAIL PROTECTED] 
Envoyé : mardi 25 juillet 2006 20:07
À : MyFaces Discussion
Objet : stupid <h:messages> question

Hi List,

I'm afraid I have a beginner's question, but either smth's terribly wrong or
I have overlooked smth trivial.
I'm just trying to display a global message, yet they won't show!

What I tried, is:

in the bean, I've tried both the "Std" way and the Apache-way (with
MessageUtils):

FacesContext ctx = FacesContext.getCurrentInstance();
ctx.addMessage(null, new FacesMessage("Test Summary","Test" ));

& MessageUtils.addMessage(FacesMessage.SEVERITY_ERROR,"secMsg_test" , null);

<--> In the page, I'v tried with both "Std" h: & Apache t: ... both without
effect:

<t:messages errorStyle="error"/>
</h:form>
<h:messages errorClass="error" />

btw as you can see, I've also tried to put them before & after the
h:form-tag. Does that really matter?

As I understood, from the moment you add a message, the same page is
redisplayed with the message.(/s) This works fine for all <h:message
for="ID-of-a-component"  />, but I never got this h:messages to work!!

Any ideas? (don't mind manners, I'm obviously missing smth basic here :-)

Wolf

Reply via email to