title: How to enable/disable primefaces commandButton?
body: <p>I have two buttons on screen. When page first loaded I want to button2 is disabled until button1 is clicked. 
  When button1 is clicked, button2 must be enabled.</p>
  
  <p>I tried:</p>
  
  <pre class="lang-xhtml prettyprint-override"><code>&lt;p:commandButton value="Normalize"
      actionListener="#{mainTable.normalize}" update="dataTable"
      id="normalize" styleClass="ui-priority-primary"
      style="font-size: 14px"&gt;
      &lt;f:setPropertyActionListener value="#{true}"
          target="#{mainTable.disable}" /&gt;
  &lt;/p:commandButton&gt;
  &lt;p:commandButton value="To Verify Next-&gt;" action="verify.xhtml"
      actionListener="#{mainTable.verify}" id="next"
      styleClass="ui-priority-primary" style="font-size: 14px"
      disabled="#{!(bean.disable)}"&gt;
  &lt;/p:commandButton&gt;
  </code></pre>
  
  <p>My bean:</p>
  
  <pre><code>@ManagedBean
  @SessionScoped
  public class MainTable
  {
  
      private boolean disable;
  
      public MainTable()
      {
          disable = false;
      }
      public boolean isDisable()
      {
          return disable;
      }
  
      public void setDisable(boolean disable)
      {
          this.disable = disable;
      }
  }
  </code></pre>
  
  <p>But it doesn't work. When I clicked button1, button2 is still disabled.
  What is wrong?</p>