This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes Override h:message renderer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Override h:message renderer" Watch "Override h:message renderer" New topic
Author

Override h:message renderer

Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
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?


MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
anyone?
Sergey Smirnov
Ranch Hand

Joined: May 29, 2003
Posts: 167
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

Joined: Aug 25, 2005
Posts: 536
thanks. that worked a treat
[ May 28, 2006: Message edited by: Mike Corleone ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Override h:message renderer
 
Similar Threads
jsf tutorial
JTable.setRowHeight() in CellRenderer/Editor: new rows not rendered
Formatting JTable columns
Invalidating image cache when using h:graphicImage
my component - my renderer