Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Avoid duplicates in RichFaces messages tag

 
Abigail Ames
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set globalOnly=true in your rich:messages components as one of the attributes.

regards,
Nirvan.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic