7 Replies Latest reply on Jan 2, 2009 2:02 AM by Stephen Friedrich

    Bug in FacesMessage propagation

    Wolfgang Schwendt Newbie

      Conversation-scoped component org.jboss.seam.faces.FacesMessages propagates FacesMessages across redirects.  To transfer messages from FacesMessages to the JSF FacesContext, Seam calls FacesMessages shortly before the View is rendered (JSF Render response phase).

      FacesMessage.beforeRenderResponse adds two types of messages to the FacesContext:  Global Messages and keyedMessages, ie. messages associated with a specific component id (NOT clientId)!  It retrieves the list of keyed messages from FacesMessages and tries to convert the component id of a keyed message to a JSF client id.

      However, here is a major bug!  FacesMessage.getClientId() tries to iterate over the JSF view tree in order to find the JSF client id for a given component id.  But the problem is that after a redirect the view tree consists only out of a single UIViewRoot component prior to the Render Response phase!  Therefore, FacesMessages.getCliendId(String componentId) always returns null because the the while condition iter.hasNext() is always false after a redirect.

      Should I file a JIRA issue?

      We need something like StatusMessages.addToControl(clientId, severity, msg) rather than addToControl(componentId, severity, msg).


      Wolfgang Schwendt