Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Override h:message renderer

 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I currently use MyFaces in my application and I would like to play a "beep" sound when an error message is displayed.

So, when the error message is rendered, I would like to add



to the error message.

How do I go about doing this? Is it just a matter of overriding MyFaces's HTMLMessage Renderer? If so, how do I make my app to use my renderer instead of MyFaces's implementation?
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyone?
 
Sergey Smirnov
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not think you have to override the default renderer just because of this beep.
The facesContext.getMaximumSeverity() returns the maximum severity level recorded on any Messages that has been queued. So, if no messages are queued, the h:messages is not rendered and #{! empty facesContext.maximumSeverity} will be equal to false.

For example,


--
Sergey : https://ajax4jsf.dev.java.net/
[ May 28, 2006: Message edited by: Sergey Smirnov ]
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks. that worked a treat
[ May 28, 2006: Message edited by: Mike Corleone ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic