8 Replies Latest reply on Aug 5, 2012 2:56 AM by navuri prasad

    a4j:commandButton does nothing on first click, works on second click

    Mark Robinson Newbie

      I have two pages where users can switch back and forth.  What happens is that I have to click the button twice to get the page to actually transition.  The problem goes away if I replace a4j:commandButton with an h:commandButton.  Am I doing something wrong with the a4j:commandButton?

       

      <f:view xmlns:util="http://java.sun.com/jsf/composite/banner" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"

              xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich">

        <html xmlns="http://www.w3.org/1999/xhtml">

          <h:head>

            <title>login</title>

          </h:head>

          <h:body>

            <h:form id="regForm">

              <util:banner/>

              <h:outputLabel value="Registration"/>

              <h:panelGrid columns="2">

                <a4j:commandButton value="Existing user?" action="login"/>

              </h:panelGrid>

            </h:form>

          </h:body>

        </html>

      </f:view>

       

      and

       

      <f:view xmlns:util="http://java.sun.com/jsf/composite/banner" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"

              xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich">

        <html xmlns="http://www.w3.org/1999/xhtml">

          <h:head>

            <title>login</title>

          </h:head>

          <h:body>

            <h:form id="loginForm">

                <a4j:commandButton value="Not an existing user?" action="registration"/>

              </h:panelGrid>

            </h:form>

          </h:body>

        </html>

      </f:view>