O'Reilly logo

PrimeFaces Cookbook - Second Edition by Oleg Varaksin, Mert Çalışkan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Targetable messages with severity levels

We sometimes need to target a FacesMessage instance to a specific component. For example, suppose we have p:growl and p:messages/p:message tags on the same page and need to display some messages as p:growl and some as p:message. PrimeFaces has a grouping feature for messages to associate a notification component to specific command components so that messages created as a result of an action will be displayed in the associated messages or the growl tags.

In this recipe, we will develop samples for targetable messages. Furthermore, we will discuss the severity attribute. By means of severity, we can display messages depending on their severities.

How to do it…

Let's use one p:messages tag and two p:growl tags, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required