title: Changing dynamically background color of commandbutton
body: <p>I want to change color dynamically of <code>commandbutton</code> in Primefaces.</p>
  
  <p>Here's code excerpt of commandbutton:</p>
  
  <pre><code>&lt;p:commandButton id="movieBtn" value="#{kkcIncomingErrorBean.counter}" 
  type="button" onclick="PF('errorTable').show()" 
  styleClass="#{kkcIncomingErrorBean.buttonStyle}"/&gt;
  </code></pre>
  
  <p><code>buttonStyle</code> is field of <code>kkcIncomingErrorBean</code> class:</p>
  
  <pre><code>private String buttonStyle="background-color:red";
  ...
  public String getButtonStyle() {
      return buttonStyle;
  }
  
  public void setButtonStyle(String buttonStyle) {
      this.buttonStyle = buttonStyle;
  }
  </code></pre>
  
  <p>It is interesting that on update <code>counter</code> variable is updated but <code>buttonStyle</code> is not updated.</p>
  
  <p>Do you have any ideas to fix this?</p>
  
  <p>With regards</p>