public class MessagesRenderer extends Renderer
OmniMessages
. It's basically copypasted from Mojarra 2.2,
including the fix of tooltip rendering as described in
issue 2164, and afterwards slightly rewritten, refactored and enhanced to take the new features into account.Modifier and Type | Field and Description |
---|---|
static String |
RENDERER_TYPE
The standard renderer type.
|
PASSTHROUGH_RENDERER_LOCALNAME_KEY
Constructor and Description |
---|
MessagesRenderer() |
Modifier and Type | Method and Description |
---|---|
void |
encodeChildren(FacesContext context,
UIComponent component) |
protected void |
encodeEmptyMessages(FacesContext context,
OmniMessages component)
Encode the case when there are no messages.
|
protected void |
encodeMessage(FacesContext context,
OmniMessages component,
FacesMessage message,
boolean table)
Encode a single faces message.
|
protected void |
encodeMessages(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 void |
encodeMessagesRepeater(FacesContext context,
OmniMessages component,
List<FacesMessage> messages)
Encode the case when the
var attribute is specified. |
protected List<FacesMessage> |
getMessages(FacesContext context,
OmniMessages component)
Collect all messages associated with components identified by
for attribute and return it. |
boolean |
getRendersChildren()
Returns
true . |
convertClientId, decode, encodeBegin, encodeEnd, getConvertedValue
public static final String RENDERER_TYPE
public boolean getRendersChildren()
true
.getRendersChildren
in class Renderer
public void encodeChildren(FacesContext context, UIComponent component) throws IOException
encodeChildren
in class Renderer
IOException
protected List<FacesMessage> getMessages(FacesContext context, OmniMessages component)
for
attribute and return it. An empty
list will be returned when there are no messages.context
- The involved faces context.component
- The messages component.for
attribute.protected void encodeMessagesRepeater(FacesContext context, OmniMessages component, List<FacesMessage> messages) throws IOException
var
attribute is specified. This will render without any HTML markup and
put the current message in the request scope as identified by the var
attribute.
Note: the iteration is by design completely stateless.context
- The involved faces context.component
- The messages component.messages
- The queued faces messages.IOException
- When an I/O error occurs.protected void encodeEmptyMessages(FacesContext context, OmniMessages component) throws IOException
context
- The involved faces context.component
- The messages component.IOException
- When an I/O error occurs.protected void encodeMessages(FacesContext context, OmniMessages component, List<FacesMessage> messages, boolean table) throws IOException
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.IOException
- When an I/O error occurs.protected void encodeMessage(FacesContext context, OmniMessages component, FacesMessage message, boolean table) throws IOException
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.IOException
- When an I/O error occurs.Copyright © 2012–2018 OmniFaces. All rights reserved.