<p:growl> <p:messages>

UI Components for JSF
Post Reply
facundo
Posts: 7
Joined: 10 Nov 2010, 20:34

21 Dec 2010, 17:05

I´m using JSF2 + PF 2.2.M1.

I want to do the following:
Automatically , when a user accesses a page , a Welcome message as a growl is displayed , and, if a condition is tested(before loading the page, no ajax) , an error message as p:message is displayed also. My problem is that both messages are displayed with the <p:growl> and <p:messages> .

I want both messages to be displayed separately, one on the p:growl an the other on the p:messages, and i´m not using ajax update, they are loaded as the page is loaded. Is it possible? Is there any attribute o parameter that specifies whether teh msessage should be displayed in the growl or de p:messages or viceversa?

Thanks.

User avatar
bumble.bee
Posts: 723
Joined: 29 Sep 2010, 21:39
Location: United States

21 Dec 2010, 22:38

I don't think you can differentiate. They both display FacesMessages. What you can do though is use the rendered attribute of each. You'll need to have a boolean value in a bean that indicates whether to use growl or messages. You can use the preRenderView system event (or preRenderComponent if you prefer) to house your logic and set your boolean value appropriately.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 59 guests