Top Description Inners Fields Constructors Methods
javax.faces.component

public Class UIMessage

extends UIComponentBase
Class Inheritance
Known Direct Subclasses
javax.faces.component.html.HtmlMessage
Imports
javax.faces.context.FacesContext

This component is responsible for displaying messages for a specific UIComponent, identified by a clientId or component id relative to the closest ancestor NamingContainer. The component obtains the messages from the FacesContext.

By default, the rendererType property must be set to "javax.faces.Message". This value can be changed by calling the setRendererType() method.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum

Field Summary

Modifier and TypeField and Description
public static final String
COMPONENT_FAMILY

The standard component family for this component.

public static final String
COMPONENT_TYPE

The standard component type for this component.

Constructor Summary

AccessConstructor and Description
public
UIMessage()

Create a new UIMessage instance with default property values.

Method Summary

Modifier and TypeMethod and Description
public String
getFamily()

Implements abstract javax.faces.component.UIComponent.getFamily.

Return the identifier of the component family to which this component belongs.

public String

Returns:

the for client identifier.
getFor
()

Return the Identifier of the component for which to render error messages.

public boolean

Returns:

true if this UIMessage instance should redisplay javax.faces.application.FacesMessages that have already been handled, otherwise returns false. By default this method will always return true if setRedisplay(boolean) has not been called.
isRedisplay
()

public boolean

Returns:

true if detail is to be shown, false otherwise.
isShowDetail
()

Return the flag indicating whether the detail property of the associated message(s) should be displayed.

public boolean

Returns:

true if the summary is to be shown, false otherwise.
isShowSummary
()

Return the flag indicating whether the summary property of the associated message(s) should be displayed.

public void
setFor(String
The new client id
newFor
)

Set the identifier of the component for which this component represents associated message(s) (if any).

public void
setRedisplay(boolean
flag indicating whether previously handled messages are redisplayed or not
redisplay
)

Set the flag indicating whether the detail property of the associated message(s) should be displayed.

public void
setShowDetail(boolean
The new flag
showDetail
)

Set the flag indicating whether the detail property of the associated message(s) should be displayed.

public void
setShowSummary(boolean
The new flag value
showSummary
)

Set the flag indicating whether the summary property of the associated message(s) should be displayed.

Inherited from javax.faces.component.UIComponentBase:
addClientBehavioraddFacesListenerbroadcastclearInitialStatedecodeencodeBeginencodeChildrenencodeEndfindComponentgetAttributesgetChildCountgetChildrengetClientBehaviorsgetClientIdgetDefaultEventNamegetDescriptorMapgetEventNamesgetFacesContextgetFacesListenersgetFacetgetFacetCountgetFacetsgetFacetsAndChildrengetIdgetListenersForEventClassgetParentgetPassThroughAttributesgetRenderergetRendererTypegetRendersChildrengetValueBindinginvokeOnComponentisRenderedisTransientmarkInitialStateprocessDecodesprocessRestoreStateprocessSaveStateprocessUpdatesprocessValidatorsqueueEventremoveFacesListenerrestoreAttachedStaterestoreStatesaveAttachedStatesaveStatesetIdsetParentsetRenderedsetRendererTypesetTransientsetValueBindingsubscribeToEventunsubscribeFromEvent

Field Detail

COMPONENT_FAMILYback to summary
public static final String COMPONENT_FAMILY

The standard component family for this component.

COMPONENT_TYPEback to summary
public static final String COMPONENT_TYPE

The standard component type for this component.

Constructor Detail

UIMessageback to summary
public UIMessage()

Create a new UIMessage instance with default property values.

Method Detail

getFamilyback to summary
public String getFamily()

Implements abstract javax.faces.component.UIComponent.getFamily.

Doc from javax.faces.component.UIComponent.getFamily.

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance. Note this method should NOT return null

Returns:String

the component family (not null).

Annotations
@Override
getForback to summary
public String getFor()

Return the Identifier of the component for which to render error messages. If this component is within the same NamingContainer as the target component, this must be the component identifier. Otherwise, it must be an absolute component identifier (starting with ":"). See the UIComponent#findComponent for more information.

Returns:String

the for client identifier.

isRedisplayback to summary
public boolean isRedisplay()
Returns:boolean

true if this UIMessage instance should redisplay javax.faces.application.FacesMessages that have already been handled, otherwise returns false. By default this method will always return true if setRedisplay(boolean) has not been called.

Since
2.0
isShowDetailback to summary
public boolean isShowDetail()

Return the flag indicating whether the detail property of the associated message(s) should be displayed. Defaults to true.

Returns:boolean

true if detail is to be shown, false otherwise.

isShowSummaryback to summary
public boolean isShowSummary()

Return the flag indicating whether the summary property of the associated message(s) should be displayed. Defaults to false.

Returns:boolean

true if the summary is to be shown, false otherwise.

setForback to summary
public void setFor(String newFor)

Set the identifier of the component for which this component represents associated message(s) (if any). This property must be set before the message is displayed.

Parameters
newFor:String

The new client id

setRedisplayback to summary
public void setRedisplay(boolean redisplay)

Set the flag indicating whether the detail property of the associated message(s) should be displayed.

Parameters
redisplay:boolean

flag indicating whether previously handled messages are redisplayed or not

Since
2.0
setShowDetailback to summary
public void setShowDetail(boolean showDetail)

Set the flag indicating whether the detail property of the associated message(s) should be displayed.

Parameters
showDetail:boolean

The new flag

setShowSummaryback to summary
public void setShowSummary(boolean showSummary)

Set the flag indicating whether the summary property of the associated message(s) should be displayed.

Parameters
showSummary:boolean

The new flag value

javax.faces.component back to summary

pack-priv final Enum UIMessage.PropertyKeys

extends Enum<UIMessage.PropertyKeys>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final UIMessage.PropertyKeys
public static final UIMessage.PropertyKeys
public static final UIMessage.PropertyKeys
public static final UIMessage.PropertyKeys
pack-priv String

Constructor Summary

AccessConstructor and Description
private
PropertyKeys(String toString)

private

Method Summary

Modifier and TypeMethod and Description
public String
toString()

Overrides java.lang.Enum.toString.

Returns the name of this enum constant, as contained in the declaration.
public static UIMessage.PropertyKeys
public static UIMessage.PropertyKeys[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinalvalueOf

Field Detail

forValueback to summary
public static final UIMessage.PropertyKeys forValue
redisplayback to summary
public static final UIMessage.PropertyKeys redisplay
showDetailback to summary
public static final UIMessage.PropertyKeys showDetail
showSummaryback to summary
public static final UIMessage.PropertyKeys showSummary
toStringback to summary
pack-priv String toString

Constructor Detail

PropertyKeysback to summary
private PropertyKeys(String toString)
PropertyKeysback to summary
private PropertyKeys()

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Enum.toString.

Doc from java.lang.Enum.toString.

Returns the name of this enum constant, as contained in the declaration. This method may be overridden, though it typically isn't necessary or desirable. An enum class should override this method when a more "programmer-friendly" string form exists.

Returns:String

the name of this enum constant

Annotations
@Override
valueOfback to summary
public static UIMessage.PropertyKeys valueOf(String name)
valuesback to summary
public static UIMessage.PropertyKeys[] values()