0 Replies Latest reply on Jun 28, 2011 11:54 AM by vasu.electronics

    Issue of a4j:commandButton with a4j:include in firefox

    vasu.electronics

      Hi All,

       

      I have a problem in using a4j with firefox. With Chrome the code works very fine.

       

      A brief explanation of my code is below

       

      My homepage is index.jsp

       

       

      <f:view>

          <a4j:outputPanel ajaxRendered="true">

              <a4j:include viewId="index1.jsp">

              </a4j:include>

              <a4j:include viewId="index2.jsp">

              </a4j:include>

              <a4j:include viewId="index3.jsp">

              </a4j:include>

          </a4j:outputPanel>

      </f:view>

       

       

      index1.jsp

       

       

      <h:form>

          <h:form>

              <div align="center">

                  <a4j:commandButton value="Invoke method"

                      action="#{formbean.doAction}"></a4j:commandButton>

              </div>

          </h:form>

      </h:form>

       

      index2.jsp

       

      <h:form rendered="#{formbean.opTxt2Rendered }">

          <h:outputText value="OPtext2"></h:outputText>

      </h:form>

       

      index3.jsp

       

      <h:form rendered="#{formbean.opTxt1Rendered }">

          <h:outputText value="OPtext1"></h:outputText>

      </h:form>

       

      Formbean is

       

      public class FormBean {

          private String inputVal;

          private boolean opTxt1Rendered=false;

          private boolean opTxt2Rendered=true;

          public FormBean() {

              System.out.println("Creating formbean");

          }

          public String doAction(){

              System.out.println("In DoAction");

              if(this.opTxt2Rendered == true){

                  this.opTxt2Rendered=false;

              }

              else{

                  this.opTxt2Rendered = true;

              }

              if(this.opTxt1Rendered == true){

                  this.opTxt1Rendered=false;

              }

              else{

                  this.opTxt1Rendered = true;

              }       

              return "";

          }

       

       

      In firefox, the doAction method is called only once, whereas in Chrome it absolutely works fine for any number of clicks on the a4j:commandButton.

       

      Do you have any idea?

       

      I havent tested the application in IE yet

       

      Thanks