You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Martin Koci <ma...@aura.cz> on 2006/04/14 15:51:29 UTC
Is implementation of org.apache.myfaces.shared.renderkit.html.HtmlMessagesRendererBase$MessagesIterator
correct?
Hello,
I'm writing custom messages renderer and found strange (for me) behavior
of MessagesIterator:
JSF spec: globalOnly: Flag indicating whether only messages not
associated with any specific component should be rendered. If not set,
ALL messages will be rendered. Default value is “false”
public MessagesIterator(FacesContext facesContext, boolean globalOnly)
{
_facesContext = facesContext;
if (globalOnly)
{
// JSF spec: The getMessages(String) method returns an Iterator over
queued Messages
// those associated with no client identifier if the parameter is null
// OK - if globalOnly is true we have only messages not attached to
component
_globalMessagesIterator = facesContext.getMessages(null);
_clientIdsWithMessagesIterator = NullIterator.instance();
}
else // globalOnly = false
{
// ??? NO global messages? JSF spec: If not set, ALL messages will be
rendered!
_globalMessagesIterator =
org.apache.myfaces.shared.util.NullIterator.instance();
// ??? - we obtain only ids with messages but NO global messages
iterator. But spec says: if globalOnly false (or not set) ALL messages
will be rendered.
_clientIdsWithMessagesIterator = facesContext.getClientIdsWithMessages();
}
_componentMessagesIterator = null;
_clientId = null;
}
Thanks for info,
Martin
--
Mgr. Martin Kočí
---------------------------------
AURA, s.r.o.
Úvoz 499/56; 602 00 Brno
ISO 9001 certifikovaná společnost
tel./fax: +420 5 43 24 51 11
e-mail: martin.koci@aura.cz
internet: http://www.aura.cz
http://www.j2ee.cz
---------------------------------