JBoss.orgCommunity Documentation
The component is used for rendering a single message for a specific component.
Highly customizable look and feel
Tracking both traditional and Ajax based requests
Optional toolTip to display the detail portion of the message
Additionally customizable with attributes and facets
Additionally provides two parts to be optionally defined: marker and label
The component has the same behavior as standard <h:message> component except next two features:
It's ajaxRendered. It means that the component is reRendered after Ajax request automatically without outputPanel usage
The component optionally provides "passed" state which will be shown if no message is displayed
Provides possibility to add some marker to message. By default a marker element isn't shown
A set of facets which can be used for marker defining:
"passedMarker" . This facet is provided to allow setting a marker to display if there is no message
"errorMarker" . This facet is provided to allow setting a marker to display if there is a message with a severity class of "ERROR"
"fatalMarker" . This facet is provided to allow setting a marker to display if there is a message with a severity class of "FATAL"
"infoMarker" . This facet is provided to allow setting a marker to display if there is a message with a severity class of "INFO"
"warnMarker" . This facet is provided to allow setting a marker to display if there is a message with a severity class of "WARN"
The following example shows different variants for component customization. The attribute "passedLabel" is used for definition of the label to display when no message appears. But the message component doesn't appear before the form submission even when state is defined as passed (on initial rendering). Boolean attribute "showSummary" defines possibility to display summary portion of displayed messages. The facets "errorMarker" and "passedMarker" set corresponding images for markers.
Example:
...
<rich:message for="id" passedLabel="No errors" showSummary="true">
<f:facet name="errorMarker">
<h:graphicImage url="/image/error.png"/>
</f:facet>
<f:facet name="passedMarker">
<h:graphicImage url="/image/passed.png"/>
</f:facet>
</rich:message>
...
Table of <rich:message> attributes.
Table 6.270. Component Identification Parameters
Name | Value |
---|---|
component-type | org.richfaces.component.RichMessage |
component-class | org.richfaces.component.html.HtmlRichMessage |
component-family | org.richfaces.component.RichMessage |
renderer-type | org.richfaces.renderkit.html.RichMessagesHtmlBaseRenderer |
tag-class | org.richfaces.taglib.RichMessageTag |
Table 6.271. Facets
Facet | Description |
---|---|
errorMarker | Redefines the content for the marker if there is message with a severity class of "ERROR" |
fatalError | Redefines the content for the marker if there is message with a severity class of "FATAL" |
infoError | Redefines the content for the marker if there is message with a severity class of "INFO" |
warnError | Redefines the content for the marker if there is message with a severity class of "WARN" |
passedError | Redefines the content for the marker if there is no message |
Table 6.272. Classes names that define a component appearance
Class name | Description |
---|---|
rich-message | Defines styles for a wrapper element |
rich-message-marker | Defines styles for a marker |
rich-message-label | Defines styles for a label |
On the component LiveDemo page you can see the example of <rich:message> usage and sources for the given example.