How to use multiple h: messages or p: messages on one page?

I am using PrimeFaces p: messages , but I think this question applies equally to h: messages

I have a composite component for I / O processing at the top of each page. (It is in the Facelets template.) To handle login errors, it has the p: messages component.

In the content area, I usually have a form that also has p: messages in it . However, if the processing of the form ever creates a message, I get the message received from the login component, as well as the place where I was intended.

This is hardly a fatal problem, but I would like to clean it up. Any suggestions?

+4
source share
1 answer

The p:messages feathers have a redisplay attribute. Set

 redisplay="false" 

to tell the message tag to only display messages that are not yet displayed on the page.

+9
source

Source: https://habr.com/ru/post/1403326/


All Articles