10 Replies Latest reply: May 21, 2011 9:01 AM by Ilya Shaikovsky RSS

    RichFaces4 a4j:ajax doesn't allow more than one comp in 'execute'

    Edilmar Alves Apprentice

      Hi,

       

      Environment: NetBeans7+GlassFish3.1+JSF2.1.0+RichFaces4.0.0Final. Browsers: Firefox4,Chrome11.

      I have many xhtml pages that worked fine in RichFaces3.3.3 with many components in 'process'.

      But after I migrated to RichFaces4.0.0, all the 'blur' events that I use don't work anymore with more that one comp.

      I made below a short example of this:

       

      <?xml version='1.0' encoding='UTF-8' ?>

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"

                      xmlns:h="http://java.sun.com/jsf/html"

                      xmlns:f="http://java.sun.com/jsf/core"

                      xmlns:ui="http://java.sun.com/jsf/facelets"

                      xmlns:a4j="http://richfaces.org/a4j"

                      xmlns:rich="http://richfaces.org/rich"

                      template="/WEB-INF/templates/templateTeste.xhtml"

                      >

        <ui:define name="content">

          <a4j:log mode="popup">

                  <h:form id="formexecute">

                      <h:outputText id="label1" value="Campo 1:" />

                      <h:inputText id="campo1" value="#{teste.campo1}">

                          <a4j:ajax execute="campo1,campo2,campo3" render="campo2,campo3" event="blur"/>

                      </h:inputText>

                      <br/>

                      <h:outputText id="label2" value="Campo 2:" />

                      <h:inputText id="campo2" value="#{teste.campo2}"/>

                      <br/>

                      <h:outputText id="label3" value="Campo 3:" />

                      <h:inputText id="campo3" value="#{teste.campo3}"/>

                      <br/>

                  </h:form>

          </a4j:log>

        </ui:define>

      </ui:composition>

      If I put execute="campo1" (only the own component), the event blur runs, campo2 and campo3 are updated, and the a4j:log displays these messages:

       

      info [13:42:00.358]: Received 'begin' event from <input id=formexecute:campo1 ...>

      info [13:42:00.435]: Received 'beforedomupdate' event from <input id=formexecute:campo1 ...>

      info [13:42:00.439]: Listing content of response changes element:

      Element update for id=formexecute:campo2

      <update id="formexecute:campo2"><![CDATA[<input id="formexecute:campo2" type="text" name="formexecute:campo2" value="2" />]]></update>

      Element update for id=formexecute:campo3

      <update id="formexecute:campo3"><![CDATA[<input id="formexecute:campo3" type="text" name="formexecute:campo3" value="3" />]]></update>

      Element update for id=javax.faces.ViewState

      <update id="javax.faces.ViewState"><![CDATA[H4sIAAAAAAAAAJWUz2sTQRTHXzdJf6StxCo9CAWLItQfG6sIYhGtYmkw/UFTiz8OOtlMk42bnfHtbLrpodiLHrwI6kGo6MFjb/4F4kEQKih48STe9Sp48s00TdqaWhzYYWb3zXvf95n3dvUHJGSAsLfMqswOlevZ4ywoTTCZ6Pj69l3/nU8xsMYg6QlWGGOOEpiBLlVCHpSEV4jkhYugR89CJ80pehIK+uYFVnjEnVDxcw6rSDEcIuy7lTUxPOYX7al8mTtq5PHH6y9TwZBnAUSSDsfDe7AEMVpZjVVC0mjsOpYQjmo/kT3PHB7YjiD/PveVfS2T8WWoDk+jkBxV7SqvBVAffRQAYU9TwBU/rGz+KBUkqsxzCw0WxuySEB5n/tpBvP9l5fdPC9puGruQR7JtSYvqVNDrCYd5c/ptjqtAv+0B0nlsJ51TofqXUO2gS9XjVBHiVeEWoDkiAqJtUlK2gn2qASuu0bUyOb3dpL182y0Mn2yBv/0v/Gd2SuvyxnpLZtPoVpniLRLcz5RCN0+qgtkSU6No8FGlNGtxFJHVsm6gouXPA8/fsxcxaMtAPHAXuSmY2EJcz3ToSGtVOUWxx6lUOeZYleOND2/OP1lZm7DAykKX47EgmGQVTpBMdab1radzJMsvjmQhGdCZgvGhoH/dwhXpHEeXamWR5T0+QrdR1QkNmos/RDDjPnls7Do8N48MaxGhs/8PXQtmySYzE2FQd4iBkKhHNGKgvtHzsYaUXoFFG12nZARsMhlqmHSzMgmk9ibVkSnw4wp6kPsEkONsTRKI9BY39vrHu66yZ3ggQnR4dj3jmfopU6t6OqC7zFTarn0eI1ondqI15/KFGSF2hdVO16sy21o64yte5Nj3/dXrX8sPz1q6oOotjZBq2k2GlTzHB6vPBrqffnu08YdKShn9AfTbtEs0BQAA]]></update>

      info [13:42:00.442]: Received 'success' event from <input id=formexecute:campo1 ...>

      info [13:42:00.443]: Received 'complete' event from <input id=formexecute:campo1 ...>

      But if I put execute="campo1,campo2,campo3", the messages are almost the same, but campo2 and campo2 aren't updated:

       

      info [13:44:53.477]: Received 'begin' event from <input id=formexecute:campo1 ...>

      info [13:44:53.496]: Received 'beforedomupdate' event from <input id=formexecute:campo1 ...>

      info [13:44:53.499]: Listing content of response changes element:

      Element update for id=formexecute:campo2

      <update id="formexecute:campo2"><![CDATA[<input id="formexecute:campo2" type="text" name="formexecute:campo2" />]]></update>

      Element update for id=formexecute:campo3

      <update id="formexecute:campo3"><![CDATA[<input id="formexecute:campo3" type="text" name="formexecute:campo3" />]]></update>

      Element update for id=javax.faces.ViewState

      <update id="javax.faces.ViewState"><![CDATA[H4sIAAAAAAAAALVUy2sTQRj/ukn6SB/EqL0VehBLFTe2IohFtIqlwfRBU4uPg04202TjZmf8dna76aHYix68COpBqOjBY2/+BeJBECooePEk3vUqeHJmut20mlo9OLAfMzvf4ze/+X2z/hVS3EPYVyMBMX1hO+Yk8apThKc6Pr163X/zfQKMCUg7jJQniCUY5qFLVJF6VeaUQ372HKjRs9QpbUZ+KQHZRYZ1GlLLF/S0ReqcjfgI+68XdA2HuBVzplSjlhh78O7Ks4w37BgAIZfBSf82rEBCzox4luJyxKuOFYQjKk9oLhKLeqbFZH6XusK8nM+73BeHZpFxiqJxiTY8iEZWFkDoawK46Pr17ZtcQCogjl2OudBu5xlzKHE3BvHOx7Uf3wxou6b9fBrythUFqlNAr8Ms4iyov0UqPPW3ByTOo7vhnPHFn4CqBF0iqhMgJANml6E5QkmI8slw3ors0Zisv6BTTdLK9CrTp9Mqk1XmYFRH77esdeK/1Wqv3bDLI8dbZG3/TRAndyP6wtZ8B9ezaAdE0BaUHyBCoF2Sx/Pmq0SMo75Qqd1md4wjkkbB9kS4+mHgyRvyNAFteUh69jLVEk4sJZWVQYdboyoKWXtSNg/FIgkoXn378szDtY0pA4wCdFkO8bxpUqeSbd0vOaXDXFHCcitjBUh7Mqascwjo3/SwWa5I0ZbqXSYlh45JfQTqQENaisOSzKQrM8arDscuIcFGKKkz/426Fpylm5zpCkPq4jUJqaiiBgPRQtmRGEovw4qJtlXVALa55GKXblKTAOWDI1GHuuVGBfQgdSWBFOcbXBKR25HG3Ny8ZQtzjnrMR4sWNk88F0XFShtUfa+Vtqd8E5KtY7uxtWDTpTnG9iSrXV6vyP/yyORdQSsUs1+ev/i+eu+UoQQVPTIImabftF8vUby7/nig+9Hn+1tvZprz8Cf0qHqtxgUAAA==]]></update>

      info [13:44:53.502]: Received 'success' event from <input id=formexecute:campo1 ...>

      info [13:44:53.503]: Received 'complete' event from <input id=formexecute:campo1 ...>

      Then, I thought there was a bug in RF4 a4j:ajax that didn't allow more than one component in a4j:ajax.

       

      Below is the code for bean:

       

      @Named

      @SessionScoped

      public class Teste implements Serializable {

        private Long campo1 = null, campo2 = null, campo3 = null;

       

        public Long getCampo1() {

          return campo1;

        }

       

        public void setCampo1(Long campo1) {

          this.campo1 = campo1;

          campo2 = campo1 * 2;

          campo3 = campo1 * 3;

        }

       

        public Long getCampo2() {

          return campo2;

        }

       

        public void setCampo2(Long campo2) {

          this.campo2 = campo2;

        }

       

        public Long getCampo3() {

          return campo3;

        }

       

        public void setCampo3(Long campo3) {

          this.campo3 = campo3;

        }

       

      }

      I tried to use f:ajax like this, but the same problem occurs:

       

      <f:ajax execute="campo1 campo2 campo3" render="campo2 campo3" event="blur"/>

      Then, I don't know what's the real problem, with JSF2 or RF4.