title: How to get state of SelectBooleanCheckbox in Ajax Listener?
body: <p>I'm trying to do some action in the ManagedBean based on the state of the checkbox. </p>
  
  <p>Checkbox is here:</p>
  
  <pre><code>&lt;p:selectBooleanCheckbox id="cb"&gt;
      &lt;p:ajax listener="#{myBB.checkboxChanged}"/&gt;
  &lt;/p:selectBooleanCheckbox&gt;
  </code></pre>
  
  <p>The signature of the listener method is this:</p>
  
  <pre><code>public void checkboxChanged(AjaxBehaviorEvent event)
  </code></pre>
  
  <p>The listener method is called as expected, but I'm not sure how to get the state of the checkbox(if it is selected)
  This is false all the time:</p>
  
  <pre><code>((SelectBooleanCheckbox)event.getSource()).isSelected()
  </code></pre>
  
  <p>Do I need to bind the value of the checkbox? I'd like to avoid that, because the checkboxes are generated from enum in a loop and I don't have any boolean where to bind it(the model is designed in a way that I'm adding/removing the instances of enum to a collection, not setting boolean properties)</p>
  
  <p>I'm running the code on Tomcat 6.0.36 with Primefaces 3.5</p>
  
  <p>JSF implementation is Apache Myfaces 2.1.10</p>