2 Replies Latest reply on Jul 20, 2011 2:13 PM by Robert Gary

    RF 3 - rich:messages decorations?

    Robert Gary Newbie

      Is it possible to provide a border around rich:messagse if messages are available? I would like the border to be around all the messages.



        • 1. Re: RF 3 - rich:messages decorations?
          Richard Clarke Newbie



          facesContext.maximumSeverity can be used to determine if any messages are present.


          You could try rendering a panel with a border using rendered="#{facesContext.maximumSeverity ne null}".


          Alternatively check (facesContext.maximumSeverity==null) in a backing bean and set a styleClass property to a named CSS style. Then use styleClass="#{bean.getStyleClass}" on your page.


          Haven't tried it but should work.


          • 2. Re: RF 3 - rich:messages decorations?
            Robert Gary Newbie


            The only issue with that is that it requires a trip to the backing bean. I'm using clientside and server side validations. However, I think I've found a clientside solution.


            .simpleSection {

                 border-style: solid;

                 border-width: thin;

                 border-color: gray;


                    <rich:messages styleClass="simpleSection" style="width:70%;border-spacing:5px;"
                                   errorClass="errorText" ajaxRendered="true" showSummary="false" showDetail="true"
                            layout="table" id="messages">
                        <f:facet name="errorMarker">
                            <h:graphicImage url="/images/Status_red.gif"/>
                        <f:facet name="infoMarker">
                            <h:graphicImage url="/images/Status_green.gif"/>


            The border is then only rendered when there is a message.