File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Avoid duplicates in RichFaces messages tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Avoid duplicates in RichFaces messages tag" Watch "Avoid duplicates in RichFaces messages tag" New topic

Avoid duplicates in RichFaces messages tag

Abigail Ames

Joined: Nov 03, 2010
Posts: 1
I am using RichFaces and JSF 1.2. I have a data entry form with multiple required inputs. Each input has the required property set to true and has its own rich:message tag so that the user sees the message right next to the input on validation failure. I also have a rich:messages tag at the top of the form for summary message display. I've overridden the default validator messages as follows:

javax.faces.component.UIInput.REQUIRED=Please enter values for all required fields
javax.faces.component.UIInput.REQUIRED_detail=Value is required

So here is my question: is there a way to avoid duplicate messages in the rich:messages display? Right now if I have multiple required field valdiation failures, my summary message is repeated for each control. I realize that there are probably many workarounds, but I'm trying to make as much use as I can of the built in validator functionality.

Thanks for your time.
B Nirvan
Ranch Hand

Joined: Oct 20, 2010
Posts: 82
Set globalOnly=true in your rich:messages components as one of the attributes.

I agree. Here's the link:
subject: Avoid duplicates in RichFaces messages tag
It's not a secret anymore!