UI-Component Sets
Project Documentation

Summary

Tag name: <h:messages>
UIComponent class: javax.faces.component.html.HtmlMessages
Tag class: org.apache.myfaces.taglib.html.HtmlMessagesTag
Component type: javax.faces.HtmlMessages
Component family: javax.faces.Messages
Renderer type: javax.faces.Messages
Renderer class: org.apache.myfaces.renderkit.html.HtmlMessagesRenderer

Renders all or some FacesMessages depending on the "for" and "globalOnly" attributes.

  • If globalOnly = true, only global messages, that have no associated clientId, will be displayed.
  • else if there is a "for" attribute, only messages that are assigned to the component referenced by the "for" attribute are displayed.
  • else all messages are displayed.

Attributes

Name Type Supports EL? Description
binding javax.faces.component.html.HtmlMessages Only EL Identifies a backing bean property (of type UIComponent or appropriate subclass) to bind " + "to this component instance. This value must be an EL expression.
dir String Yes HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).
errorClass String Yes CSS class to be used for messages with severity "ERROR".
errorStyle String Yes CSS style to be used for messages with severity "ERROR".
fatalClass String Yes CSS class to be used for messages with severity "FATAL".
fatalStyle String Yes CSS style to be used for messages with severity "FATAL".
for String Yes The ID of the component whose attached FacesMessage object (if present) should be diplayed by this component. It takes precedence over globalOnly.
globalOnly boolean Yes Specifies whether only messages (FacesMessage objects) not associated with a specific component should be displayed, ie whether messages should be ignored if they are attached to a particular component. Defaults to false.
id String Yes Get a string which uniquely identifies this UIComponent within the scope of the nearest ancestor NamingContainer component. The id is not necessarily unique across all components in the current view.
infoClass String Yes CSS class to be used for messages with severity "INFO".
infoStyle String Yes CSS style to be used for messages with severity "INFO".
lang String Yes HTML: The base language of this document.
layout String Yes The layout: "table" or "list". Default: list
rendered boolean Yes A boolean value that indicates whether this component should be rendered. Default value: true.
showDetail boolean Yes Specifies whether the detailed information from the message should be shown. Default to false.
showSummary boolean Yes Specifies whether the summary information from the message should be shown. Defaults to true.
style String Yes HTML: CSS styling instructions.
styleClass String Yes The CSS class for this element. Corresponds to the HTML 'class' attribute.
title String Yes HTML: An advisory title for this element. Often used by the user agent as a tooltip.
tooltip boolean Yes If true, the message summary will be rendered as a tooltip (i.e. HTML title attribute).
warnClass String Yes CSS class to be used for messages with severity "WARN".
warnStyle String Yes CSS style to be used for messages with severity "WARN".