2 Replies Latest reply on Nov 23, 2012 1:42 AM by strannik

    rich:messages disappears

    strannik

      Hi, all

       

      I encountered weird behavior of the rich:messages component.

      I have input page with validation. If input text is blank then error message is displayed after form has been submitted.

      Hoewever the block with jsFunction breaks this behavior. If this block is present then error message is displayed and disappears.

       

      Please advice.

       

      <rich:messages errorClass="errors"
      <h:inputText id="fname" value="#{account.fname}" required="true"
      validatorMessage="#{msg['profile.fname.required']}"
      requiredMessage="#{msg['profile.fname.required']}">
      <f:validateRequired />
      </h:inputText>

       

       

       

      <rich:jQuery selector="document" query="ready(updateCelebraters())" />

       

      <a4j:jsFunction name="updateCelebraters"
      action="#{accountController.updateCelebraters(contextBean)}" />
        • 1. Re: rich:messages disappears
          strannik

          Here's a4j log.

           

           

          info [11:28:19.427]: Received 'begin' event from <span id=mainMenu:j_idt181 ...>

           

          info [11:28:19.616]: Received 'beforedomupdate' event from <span id=mainMenu:j_idt181 ...>

          info [11:28:19.621]: Listing content of response changes element:
          Element update for id=profile:j_idt315
          <update id="profile:j_idt315"><![CDATA[<span class="rf-msgs " id="profile:j_idt315"></span>]]></update>
          Element update for id=javax.faces.ViewState
          <update id="javax.faces.ViewState"><![CDATA[e60s2]]></update>
          Element extension for id=org.richfaces.extension
          <extension id="org.richfaces.extension"><complete>new RichFaces.ui.Message("profile:j_idt315",{"isMessages":true} );</complete></extension>

          info [11:28:19.624]: Received 'success' event from <span id=mainMenu:j_idt181 ...>

          info [11:28:19.625]: Received 'complete' event from <span id=mainMenu:j_idt181 ...>

          • 2. Re: rich:messages disappears
            strannik

            I tried to deeper investigate the issue.

             

            It looks like the jQuery component totally changed the web processing.

            In the first case(without jQuery) I pressed the button and browser sends POST and GET requests.

             

            The POST request returns the same web page with error message. GET requests returns nothing.

             

            In the second case (with jQuery) browser sends two POST and one GET request.

             

            GET request returns nothing. First POST request returns "new RichFaces.ui.Message("profile:j_idt309",{"isMessages":true} );"

            Second POST request returns

             

            <?xml version='1.0' encoding='UTF-8'?> <partial-response>
            <changes><update id="profile:j_idt309"><![CDATA[<span class="rf-msgs "
            id="profile
            :j_idt309"></span>]]></update><update id="javax.faces.ViewState">
            <![CDATA[e20s2]]></update><extension
            id="org.richfaces.extension"><complete>new RichFaces.ui.Message(&quot;profile:j_idt309&quot;,{&quot;isMessages&quot;:true} );
            </complete></extension></changes></partial-response>

             

            Any ideas?