title: commandbutton not executing action if other attributes are bind to managed bean
body: <p>i'm really new to jsf.
  I need to enable,disable, render or not render some buttons on a page depending on the logged user privileges. The page is bound to a request scoped managed bean , i bind the rendered or disabled attribute of the commandbutton to a "visible" property of the managed bean, and an actionlistener to a managedbean method which has the only purpose to navigate to another page.
  If i bind one of the above properties to the visibile property, the navigation method doesn't get called, and the same page gets rerendered with the button disabled or not rendered.
  The more urget need is the answer to "how do i disable or hide the button?" of course,
  But , since i guess the problem is due to jsf page life cycle and the bean scope, i'd like also to be direct to some tutorial a bit more advanced than the hello world that can be found around.</p>
  
  <p>below are part of the code.
  Thank you in advance for any help</p>
  
  <p>the xhtml page</p>
  
  <pre><code>    &lt;ui:define name="content"&gt;      
      &lt;p:layoutUnit position="center" header="Dettaglio Pratica" scrollable="true"&gt;
          &lt;h:form id="formDettaglioPratica"&gt;
          &lt;!-- i've used javascript to redirect --&gt;
          &lt;p:commandButton styleClass="commandButton" value="Modifica pratica" ajax="false"
               rendered="#{praticaCtrl.visible}" onclick="navigateToChange();return false;"/&gt;
          &lt;p:commandButton id="backButton" styleClass="commandButton" value="Torna alla lista" 
          onclick="navigateToHome();return false;"&gt;&lt;/p:commandButton&gt;
          &lt;!-- never redirect to page defined in method checkIn --&gt;
           &lt;p:commandButton id="checkinButton" styleClass="commandButton" value="Rilascia pratica" ajax="false" 
             actionListener="#{praticaCtrl.checkIn}" disabled="#{praticaCtrl.visible}"&gt;&lt;/p:commandButton&gt;
  
              &lt;!-- printing output values --&gt;
  
          &lt;h:inputHidden id="idPratica" value="#{praticaCtrl.idPratica}"&gt;&lt;/h:inputHidden&gt;
          &lt;h:inputHidden id="idBox" value="#{praticaCtrl.box}"&gt;&lt;/h:inputHidden&gt;
          &lt;/h:form&gt;
      &lt;/p:layoutUnit&gt;
  &lt;/ui:define&gt;
  </code></pre>
  
  <p>the relevant part of the managed bean</p>
  
  <pre><code>    public boolean isVisible() {
      return isVisible;
  }
  
  public void setVisible(boolean isVisible) {
      this.isVisible = isVisible;
  }
  
  public void setUser(IUserProvider user) {
      try{
      if(pratica.getUtenteCheckOut() == null
      || (pratica.getUtenteCheckOut().getMatricola().equalsIgnoreCase(user.getUser().getMatricola()))     
      )
          setVisible(true);   
      else
          setVisible(false);
  
      this.user = user;
      }
      catch(Exception ex)
      {log.error(ex);}
  }
  
  public void checkIn(ActionEvent event)
  {
      try{
      log.info(String.format("modifica della pratica %s", idPratica));
      ajaxRedirect(String.format("../Box/ListaRichieste.xhtml?box=%s",box));
      }
      catch(Exception ex)
      {
          log.error(ex.getMessage(),ex);
      }
  }
  </code></pre>
  
  <p>this is the ajaxRedirect method,we don't use the navigation rules neither methods return string</p>
  
  <pre><code>protected void ajaxRedirect(String url) throws IOException {
      FacesContext.getCurrentInstance().getExternalContext()
      .redirect(url);     
  }
  </code></pre>