6 Replies Latest reply on Aug 10, 2007 10:08 AM by paata lominadze

    modal panel and jsf h:messages

    paata lominadze Master

      good day,
      i have messages on my modal panel and it works fine, i have messages also on page frome where i call modal panel, but problem is that i see messages on modal panel and on page also, this message tags are in differend form: example :

      <f:view>
       <h:form id="admbodyForm">
       ............. some operations
       <a4j:outputPanel ajaxRendered="true">
       <h:messages id="redIdValidation" layout="table"/>
       </a4j:outputPanel>
       </h:form>
       <modPanel:modalPanel id="mp" ..............>
       ............. some operations
       <a4j:outputPanel ajaxRendered="true">
       <h:messages id="modalError" layout="table"/>
       </a4j:outputPanel>
       </h:form>
      <f:view>
      


      how i can separate message for modal panel and for page, i don't need messages on both of them, modal panel message must not be shown on page.



        • 1. Re: modal panel and jsf h:messages
          paata lominadze Master

          sorry i have incorrect example there,:

          <f:view>
           <h:form id="admbodyForm">
           ............. some operations
           <a4j:outputPanel ajaxRendered="true">
           <h:messages id="redIdValidation" layout="table"/>
           </a4j:outputPanel>
           </h:form>
           <modPanel:modalPanel id="mp" ..............>
           <h:form id = "modalFormId">
           ............. some operations
           <a4j:outputPanel ajaxRendered="true">
           <h:messages id="modalError" layout="table"/>
           </a4j:outputPanel>
           </h:form>
           </modPanel:modalPanel>
          <f:view>
          
          


          • 3. Re: modal panel and jsf h:messages
            Igor Shabalov Apprentice

            you cannot split h:messages into two sections.

            few advises:
            1. use h:message with for="" attribute. In that case you need to explicitly refer to all inputs that you have on page

            2. do not re-render messages on underlying window

            3. Use custom messages output code, filtering messages by client id. We have rich:messages with some additional functions, but the idea to add filtering capability just get to our attention :-)

            I think we will have something for your case in next release, stay tuned.

            • 4. Re: modal panel and jsf h:messages
              paata lominadze Master

              good day,
              thank you ishabalov for your post. i have questions

              "ishabalov" wrote:

              1. use h:message with for="" attribute. In that case you need to explicitly refer to all inputs that you have on page

              i have done it, change my code like this :
              <a4j:outputPanel ajaxRendered="true">
               <h:message id="redIdValidation" for="inputfield"/>
              </a4j:outputPanel>
              

              but now message not appears :(, i got warnings on server side like this:
              03:22:49,257 INFO [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
              sourceId=null[severity=(INFO 0), summary=(Must Not Be Null.), detail=(Must Not Be Null.)]
              

              is there any needed changes in backing bean ??

              "ishabalov" wrote:

              2. do not re-render messages on underlying window

              ok, i won't.

              and

              "ishabalov" wrote:

              3. Use custom messages output code, filtering messages by client id. We have rich:messages with some additional functions, but the idea to add filtering capability just get to our attention :-)
              I think we will have something for your case in next release, stay tuned.


              sorry but i did not understand, i don't know what does it mean "filtering messages by client id", is there any documentations on wiki or examples, ooh and what about rich:messages, i got richfaces from repository on 26.07.07, and build it.
              after all i searched messages and fount example into sandbox,

              but i don't know how i can build message in backing bean with ajax functionality ?
              in this example there is no ajax function and there is only rich:messages example not rich:message, can you help me?


              Thank you In Advance.






              • 6. Re: modal panel and jsf h:messages
                paata lominadze Master

                i could not resolve this problem yet.

                any idea will be appreciated