2 Replies Latest reply on Jan 30, 2009 9:42 AM by mahendan

    rich:messages not working

    mahendan

      Hi,

      It seems richfaces 3.3.0 isn't working with SWF Message Context.

      None of the messages I put into the message context are showing up in the rich:messages component. It was working in richfaces 3.2.1 however since I upgraded it's no longer working and I have not changed any of my code.

      On the same page I have a h:messages component and the messages display appear in that component.



      Thank you,

      Mahendan

        • 1. Re: rich:messages not working
          nbelaevski

          Hello Mahendan,

          Can you please provide some more information:
          1. What do you mean by SWF Message Context
          2. Full page code?
          Thank you in advance!

          • 2. Re: rich:messages not working
            mahendan

            I am using Spring Webflow2 in the backend for the controller framework. To display a messages in the front I add my messages to Spring Webflows Message context (org.springframework.binding.message.DefaultMessageContext) which is injected into the action method. The way I do this is provided below:

            public void changeDocument(CurrentDocumentBean currentDocument, DefaultMessageContext context) {
            .
            .
            context.addMessage(new MessageBuilder().error().code("fieldIsRequired").build());
            .
            .
            
            }
            


            Here is a snippet from my flow config file:
            <view-state id="view">
            
            
            
             <transition on="changeDocument">
             <evaluate expression="viewAction.changeDocument(contentList, currentDocument, messageContext)" />
             <render fragments="metaDataFragment, imageFragment, sideParts, globalMessageFragment"/>
             </transition>
            
            </view-state>
            


            Then in the front end I display the message in the following manner:
             <a4j:outputPanel id="globalMessageFragment">
             <rich:panel bodyClass="rich-laguna-panel-no-header" styleClass="rcolAttributes marginBottom1px" rendered="#{! empty messageContext.allMessages }">
             <rich:messages errorClass="verticalCenter" errorLabelClass="Arial_09_red_bold verticalCenter" infoLabelClass="Arial_09_green_bold verticalCenter" layout="table">
             <f:facet name="errorMarker">
             <h:graphicImage styleClass="errorGifImage" url="../../DocWorkbenchStatic/images/error.gif" />
             </f:facet>
             <f:facet name="passedMarker">
             <h:graphicImage styleClass="errorGifImage" url="../../DocWorkbenchStatic/images/passed.gif" />
             </f:facet>
             </rich:messages>
             </rich:panel>
             </a4j:outputPanel>
            


            The message does not appear in this component... However in Richfaces 3.2.1 this worked... So right now I had to roll back to 3.2.1 but I really want to take advantage of some of the features from 3.3.0 :(

            I modified the above to look like this:
            <a4j:outputPanel id="globalMessageFragment">
             <rich:panel bodyClass="rich-laguna-panel-no-header" styleClass="rcolAttributes marginBottom1px" rendered="#{! empty messageContext.allMessages }">
             <rich:messages errorClass="verticalCenter" errorLabelClass="Arial_09_red_bold verticalCenter" infoLabelClass="Arial_09_green_bold verticalCenter" layout="table">
             <f:facet name="errorMarker">
             <h:graphicImage styleClass="errorGifImage" url="../../DocWorkbenchStatic/images/error.gif" />
             </f:facet>
             <f:facet name="passedMarker">
             <h:graphicImage styleClass="errorGifImage" url="../../DocWorkbenchStatic/images/passed.gif" />
             </f:facet>
             </rich:messages>
            
             <h:messages errorClass="errors" />
             </rich:panel>
             </a4j:outputPanel>
            

            When I do this error messages are displayed in the h:messages component but not in the rich:messages.



            Hope that helps,

            Mahendan