title: Problem with Richfaces 4 and JSF2.0 when a4j:commandLink and a4j:commandButton not working properly
body: <p>I have a simple login form. When I click Login, the a4j:commandButton works well and the place where contain Login form become the User Information with Logout link. But when I click the Logout link the ajax just show the status but nothing happen if I click it again the user will be logged out just what I want</p>
  
  <p>That's mean I must click twice to log the user out ??? What happen ?</p>
  
  <pre><code>&lt;a4j:outputPanel id="login_wrapper" ajaxRendered="true"&gt;
                  &lt;h:form id="fm_logged" rendered="#{mAccount.loggedIn}"&gt;
                      &lt;h3&gt;User Information&lt;/h3&gt;
                      &lt;a4j:status name="login_form_status"&gt;
                              &lt;f:facet name="start"&gt;
                                      &lt;h:graphicImage library="images" name="ajax-loader.gif" /&gt;
                              &lt;/f:facet&gt;
                      &lt;/a4j:status&gt;
  
                      &lt;h6&gt;&lt;h:outputText value="Welcome! #{mAccount.acc.name}" /&gt;&lt;/h6&gt;
                          &lt;ul class="list1"&gt;
                          &lt;li&gt;&lt;h:link value="User Account Control" outcome="/pages/management/buyer_home" style="text-decoration:none;"&gt;&lt;/h:link&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a4j:commandLink id="logout" status="login_form_status" actionListener="#{mAccount.Logout}" value="Logout" style="text-decoration:none;"&gt;&lt;/a4j:commandLink&gt;&lt;/li&gt;
                          &lt;/ul&gt;
                  &lt;/h:form&gt;           
                  &lt;h:form id="login-form" class="login-form" rendered="#{!mAccount.loggedIn}" &gt;
                      &lt;h3&gt;Login Form&lt;/h3&gt; 
                      &lt;a4j:status name="login_form_status"&gt;
                              &lt;f:facet name="start"&gt;
                                      &lt;h:graphicImage library="images" name="ajax-loader.gif" /&gt;
                              &lt;/f:facet&gt;
                      &lt;/a4j:status&gt;                       
                      &lt;h:outputText value="Wrong username or password" rendered="#{mAccount.wrongUsername}" style="color:red;" /&gt;
                      &lt;fieldset&gt;
                          &lt;div class="field"&gt;
                              &lt;label&gt;Email: &lt;/label&gt;&lt;h:inputText value="#{mAccount.acc.email}" /&gt; 
                          &lt;/div&gt;
                          &lt;div class="field"&gt;
                              &lt;label&gt;Password&lt;/label&gt;&lt;h:inputSecret value="#{mAccount.acc.password}" /&gt; 
                          &lt;/div&gt;
                          &lt;div class="field"&gt;
                              &lt;label class="alt"&gt;Remember me&lt;/label&gt;&lt;h:selectBooleanCheckbox value="#{mAccount.rememberMe}" /&gt;
                          &lt;/div&gt;
  
                          &lt;ul&gt;
                              &lt;li&gt;&lt;h:link outcome="forgot_password"&gt;Forgot your password?&lt;/h:link&gt;
                              &lt;/li&gt;
                              &lt;li&gt;&lt;h:link outcome="registration"&gt;Create an account.&lt;/h:link&gt;
                              &lt;/li&gt;
                          &lt;/ul&gt;
  
                          &lt;div class="wrapper"&gt;
                              &lt;a4j:commandButton id="login" status="login_form_status" value="Login" actionListener="#{mAccount.Login}"&gt; &lt;/a4j:commandButton&gt;
                          &lt;/div&gt;
                      &lt;/fieldset&gt;
                  &lt;/h:form&gt;
              &lt;/a4j:outputPanel&gt;
  </code></pre>