15.3. <rich:messages>
The
<rich:messages> components works similarly to the <rich:message> component, but can display all the validation messages added for the current view instead of just a single message. Refer to Section 15.2, “<rich:message>” for details on the <rich:message> component.
15.3.1. Basic usage
The
<rich:messages> component doesn't require any extra attributes for basic usage. It displays all messages relating to requests from components.
To limit the messages to a specific component, use the
for attribute to reference the component's identifier.
To show only those messages that are not attached to specific components, set
globalOnly="true".
The
<rich:messages> component is automatically rendered after an Ajax request. This occurs without the use of an <a4j:outputPanel> component or a specific reference through the render attribute of the Ajax request source.
15.3.2. Appearance
The
<rich:messages> component displays error messages for each validating component in the same container.
The
<rich:messages> component can be further styled through CSS, the same as for the <rich:message> component. Refer to Section 15.2.2, “Appearance” for an example of message styling, and refer to Section 15.3.4, “Style classes and skin parameters” for a complete list of style classes for the <rich:message> component.
The layout of the messages can also be customized through CSS. By default, the messages are arranged in a block as shown in Figure 15.4, “Messages in a block”.
Override the display property for all CSS message classes to customize the layout as follows:
- Display messages in a list with no icons
- To display the messages in a list format without the default icons, override the message styles as follows:
.rf-msg-err, .rf-msgs-err, .rf-msg-ftl, .rf-msgs-ftl, .rf-msg-inf, .rf-msgs-inf, .rf-msg-wrn, .rf-msgs-wrn, .rf-msg-ok, .rf-msgs-ok { display: list-item; margin-left: 20px; padding-left: 0px; } .rf-msg-err, .rf-msgs-err{ background-image:none; } - Display in-line messages
- To display the messages in line with text, override the message styles as follows:
.rf-msg-err, .rf-msgs-err, .rf-msg-ftl, .rf-msgs-ftl, .rf-msg-inf, .rf-msgs-inf, .rf-msg-wrn, .rf-msgs-wrn, .rf-msg-ok, .rf-msgs-ok { display:inline; }
15.3.3. Reference data
component-type:org.richfaces.Messagescomponent-class:org.richfaces.component.html.HtmlMessagescomponent-family:javax.faces.Messagesrenderer-type:org.richfaces.MessagesRenderer
15.3.4. Style classes and skin parameters
Table 15.2. Style classes (selectors) and corresponding skin parameters
| Class (selector) | Skin Parameters | Mapped CSS properties |
|---|---|---|
| generalFamilyFont
|
font-family
|
generalSizeFont
|
font-size
| |
| errorColor
|
color
|
| errorColor
|
color
|
| generalTextColor
|
color
|
| warningTextColor
|
color
|
| generalTextColor
|
color
|
| No skin parameters. | |



