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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Override h:message renderer" Watch "Override h:message renderer" New topic

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
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