5 Replies Latest reply on Apr 13, 2011 9:01 AM by beanfarmer

    rich messages place holder

    beanfarmer

      Hi there,

       

      Currently I am displaying rich messages at the top due to that my view is disturbed.

       

      Hence in absense of messages I want to put a place holder for single message to start with.

      like [code=java]<rich:spacer height="some x" rendered="say what?"/>[/code]

       

       

      Could you suggest me how to check for presence of messages?

      I have tried using [code=java]#{! facesContext.messages.hasNext()} [/code]but it didn't work, I mean after message is created then hasNext() is true in entire seam conversation. Strange that the iterator facesContext.messages never advances.

       

       

      Thanks in advance.

        • 1. rich messages place holder
          ilya_shaikovsky

          1) use #{facesContext.maximumSeverity==null} condition.

          2) why you can't just always render some placeholder and just add emssagess inside? So it will be either empty or contains messages?

          • 2. rich messages place holder
            beanfarmer

            I am so thankful to you. I am going to incorporate the condition and let you know ...

             

            May be my sentence construction is wrong. Sorry for that.

             

            What I mean is

            A rich message  always is a new line.

            In absense of message I want to have empty line so as user can not notice the view components going up and down.

             

            Hope I have expressed it properly now.

             

            Regards

            • 3. rich messages place holder
              beanfarmer

              Sorry my scenario is a bit strange.

              I have a paginated view in that each record will have selection icon. On click of that a message wil be displayed at the top.

               

              <rich:messages  globalOnly="true" labelClass="message" layout="table">

                        ...

                        ...

              </rich:messages>

               

              <rich:spacer height="10" redered="#{facesContext.maximumSeverity==null}"/>

               

              Value change Sequence #{facesContext.maximumSeverity==null}.

               

              1. true  ----  initially when paginated results view renedered.

               

              2. false ---- when message displayed for the first time. 

               

              3. false ---- when navigated to next page through  datascroller, message disappears and but #{facesContext.maximumSeverity==null} is still false.

               

                  I think rich:messages tag is something special getting refreshed for other rich component requests.

               

                  but other tags still have to wait for next GET .xhtml request upon  which it shows "true" for  #{facesContext.maximumSeverity==null} .

               

               

              Hence I gave up this idea. Thanks for your support.

              • 4. rich messages place holder
                ilya_shaikovsky

                <rich:spacer height="10" redered="#{facesContext.maximumSeverity==null}"/>

                 

                such component should be explicitly updated using reRender or wrapped to ajaxRendered outputPanel. only messages and outputPanels getting updated automatically.

                • 5. rich messages place holder
                  beanfarmer

                  Thanks for your reponse. I have tried it and working and my solution causing more gap and its there all the time. So I better allow it to insert new line on new message. I have explined it to my customer and no issues in having jumping view.