user2572526
user2572526

Reputation: 1279

How to use a single <p:messages> for a specific form without duplicating p:growl

I'm using PrimeFaces 5.0 and have a problem with the basic validation messages. I've many <p:inputText> fields that are all required, how can I link a single <p:messages> to all fields?

If I use the for attribute I can link it just to a single text field. If I don't use the for attribute the <p:messages> tag catches also messages that are not for him (it duplicates the messages sent to the <p:growl> tag for example).

Upvotes: 0

Views: 1105

Answers (1)

BalusC
BalusC

Reputation: 1108732

Just tell the <p:messages> to not redisplay (duplicate, as you say) the already displayed messages. Provided that the <p:growl> in question is being placed in the view before the <p:messages>, then it's a matter of setting its redisplay attribute to false.

<p:growl ... />
...
<p:messages ... redisplay="false" />

Upvotes: 2

Related Questions