5 Replies Latest reply on Mar 9, 2011 7:37 AM by geschtli

    Second click problem resolved

    geschtli Newbie

      Ilya are right. There is no intervention required.

       

      Two different ajax views should be handled in ONE form, and

      not in two separate.

       

      A simple example shows it:

       

       

      <ui:define name="top">

                   <h:form>

                   <h:panelGrid id="panel" columns="5">

       

                     <h:panelGroup rendered="#{!loginBean.loggedIn}">

       

                     <!--  <ui:include src="/sections/header/loginHeader.xhtml"/> -->

                     <div style="width:60%;font-size:14px;line-height:42px;background-color:white;color:black">

       

       

                         <h:outputText value="#{msg.name}" />

                         <h:inputText value="#{loginBean.alias}" required="true" />

                         <h:outputText value="#{msg.pwd}" />

                         <h:inputSecret  value="#{loginBean.password}"  required="true" />

                         <h:commandButton value="Login" action="#{loginBean.checkLogin}" >

                            <a4j:ajax execute="@form" render=":refl" />

                         </h:commandButton>                

       

                     </div>

                     </h:panelGroup>

       

                     <h:panelGroup rendered="#{loginBean.loggedIn}">

                        <!-- <ui:include src="/sections/header/logoutHeader.xhtml"/> -->

       

                         <h:commandButton value="Logout" action="#{loginBean.logout}" >

                            <a4j:ajax execute="@form" render=":refl" />

                          </h:commandButton>

       

       

                     </h:panelGroup>

       

                   </h:panelGrid>

                   </h:form> 

              </ui:define>

       

       

      The two commandButton tags should not be respectivaly suround with (<form></form>) tags.