This renderer is the default renderer of
OmniMessages. It's basically copypasted from Mojarra 2.2, and afterwards slightly rewritten, refactored and
enhanced to take the new features into account.- Since:
- 1.5
- Author:
- Bauke Scholtz
-
Field Summary
FieldsFields inherited from class jakarta.faces.render.Renderer
PASSTHROUGH_RENDERER_LOCALNAME_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidencodeChildren(FacesContext context, OmniMessages component) protected voidencodeEmptyMessages(FacesContext context, OmniMessages component) Encode the case when there are no messages.protected voidencodeMessage(FacesContext context, OmniMessages component, FacesMessage message, boolean table) Encode a single faces message.protected voidencodeMessages(FacesContext context, OmniMessages component, List<FacesMessage> messages, boolean table) Encode the case when the faces messages are to be rendered as either a HTML table or a HTML list.protected voidencodeMessagesRepeater(FacesContext context, OmniMessages component, List<FacesMessage> messages) Encode the case when thevarattribute is specified.protected List<FacesMessage>getMessages(FacesContext context, OmniMessages component) Collect all messages associated with components identified byforattribute and return it.booleanReturnstrue.Methods inherited from class jakarta.faces.render.Renderer
convertClientId, decode, encodeBegin, encodeEnd, getConvertedValue
-
Field Details
-
RENDERER_TYPE
The standard renderer type.- See Also:
-
-
Constructor Details
-
MessagesRenderer
public MessagesRenderer()
-
-
Method Details
-
getRendersChildren
public boolean getRendersChildren()Returnstrue.- Overrides:
getRendersChildrenin classRenderer<OmniMessages>
-
encodeChildren
- Overrides:
encodeChildrenin classRenderer<OmniMessages>- Throws:
IOException
-
getMessages
Collect all messages associated with components identified byforattribute and return it. An empty list will be returned when there are no messages.- Parameters:
context- The involved faces context.component- The messages component.- Returns:
- All messages associated with components identified by
forattribute.
-
encodeMessagesRepeater
protected void encodeMessagesRepeater(FacesContext context, OmniMessages component, List<FacesMessage> messages) throws IOException Encode the case when thevarattribute is specified. This will render without any HTML markup and put the current message in the request scope as identified by thevarattribute. Note: the iteration is by design completely stateless.- Parameters:
context- The involved faces context.component- The messages component.messages- The queued faces messages.- Throws:
IOException- When an I/O error occurs.
-
encodeEmptyMessages
Encode the case when there are no messages. This will render a div when the ID is specified.- Parameters:
context- The involved faces context.component- The messages component.- Throws:
IOException- When an I/O error occurs.
-
encodeMessages
protected void encodeMessages(FacesContext context, OmniMessages component, List<FacesMessage> messages, boolean table) throws IOException Encode the case when the faces messages are to be rendered as either a HTML table or a HTML list.- Parameters:
context- The involved faces context.component- The messages component.messages- The queued faces messages.table- Whether to render the messages as a HTML table or a HTML list.- Throws:
IOException- When an I/O error occurs.
-
encodeMessage
protected void encodeMessage(FacesContext context, OmniMessages component, FacesMessage message, boolean table) throws IOException Encode a single faces message.- Parameters:
context- The involved faces context.component- The messages component.message- The queued faces message.table- Whether to render the messages as a HTML table or a HTML list.- Throws:
IOException- When an I/O error occurs.
-