Top Description Inners Fields Constructors Methods
jakarta.faces.component

public Class UIMessages

extends UIComponentBase
Class Inheritance
Known Direct Subclasses
jakarta.faces.component.html.HtmlMessages
Imports
jakarta.faces.context.FacesContext

The renderer for this component is responsible for obtaining the messages from the FacesContext and displaying them to the user.

This component supports the Messages renderer-type.

By default, the rendererType property must be set to "jakarta.faces.Messages". 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
UIMessages()

Create a new UIMessages instance with default property values.

Method Summary

Modifier and TypeMethod and Description
public String
getFamily()

Implements abstract jakarta.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 client identifier of the component for which this component represents associated message(s) (if any).

public boolean

Returns:

true if only global messages are to be shown, false otherwise.
isGlobalOnly
()

Return the flag indicating whether only global messages (that is, messages with no associated client identifier) should be rendered.

public boolean

Returns:

true if this UIMessage instance should redisplay jakarta.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 client identifier of the component for which this component represents associated message(s) (if any).

public void
setGlobalOnly(boolean
The new flag value
globalOnly
)

Set the flag indicating whether only global messages (that is, messages with no associated client identifier) should be rendered.

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 jakarta.faces.component.UIComponentBase:
addClientBehavioraddFacesListenerbroadcastclearInitialStatedecodeencodeBeginencodeChildrenencodeEndfindComponentgetAttributesgetChildCountgetChildrengetClientBehaviorsgetClientIdgetDefaultEventNamegetDescriptorMapgetEventNamesgetFacesContextgetFacesListenersgetFacetgetFacetCountgetFacetsgetFacetsAndChildrengetIdgetListenersForEventClassgetParentgetPassThroughAttributesgetRenderergetRendererTypegetRendersChildreninvokeOnComponentisRenderedisTransientmarkInitialStateprocessDecodesprocessRestoreStateprocessSaveStateprocessUpdatesprocessValidatorsqueueEventremoveFacesListenerrestoreAttachedStaterestoreStatesaveAttachedStatesaveStatesetIdsetParentsetRenderedsetRendererTypesetTransientsubscribeToEventunsubscribeFromEvent

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

UIMessagesback to summary
public UIMessages()

Create a new UIMessages instance with default property values.

Method Detail

getFamilyback to summary
public String getFamily()

Implements abstract jakarta.faces.component.UIComponent.getFamily.

Doc from jakarta.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 client identifier of the component for which this component represents associated message(s) (if any).

Returns:String

the for client identifier.

isGlobalOnlyback to summary
public boolean isGlobalOnly()

Return the flag indicating whether only global messages (that is, messages with no associated client identifier) should be rendered. Mutually exclusive with the "for" property which takes precedence. Defaults to false.

Returns:boolean

true if only global messages are to be shown, false otherwise.

isRedisplayback to summary
public boolean isRedisplay()
Returns:boolean

true if this UIMessage instance should redisplay jakarta.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 false.

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

Returns:boolean

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

setForback to summary
public void setFor(String newFor)

Set the client 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

setGlobalOnlyback to summary
public void setGlobalOnly(boolean globalOnly)

Set the flag indicating whether only global messages (that is, messages with no associated client identifier) should be rendered.

Parameters
globalOnly:boolean

The new flag value

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

jakarta.faces.component back to summary

pack-priv final Enum UIMessages.PropertyKeys

extends Enum<UIMessages.PropertyKeys>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final UIMessages.PropertyKeys
public static final UIMessages.PropertyKeys
public static final UIMessages.PropertyKeys
public static final UIMessages.PropertyKeys
public static final UIMessages.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 UIMessages.PropertyKeys
public static UIMessages.PropertyKeys[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinalvalueOf

Field Detail

forValueback to summary
public static final UIMessages.PropertyKeys forValue
globalOnlyback to summary
public static final UIMessages.PropertyKeys globalOnly
redisplayback to summary
public static final UIMessages.PropertyKeys redisplay
showDetailback to summary
public static final UIMessages.PropertyKeys showDetail
showSummaryback to summary
public static final UIMessages.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 UIMessages.PropertyKeys valueOf(String name)
valuesback to summary
public static UIMessages.PropertyKeys[] values()