title: How can I determine whether a Primefaces RadioCheckbox was checked?
body: <p>I know there are lot of examples here that shows how to count the checked checkboxes but for some reason I'm unable to make this work.</p>
  
  <p>What I'm trying to do is that when at least one checkbox in my page is checked a button should be enable or disable if none of the checkboxes are checked.</p>
  
  <p>The thing is even that I implemented the following code, the count of checked checkboxes is always 0, I'm not sure what I'm missing.</p>
  
  <p><strong>Primefaces component:</strong></p>
  
  <pre><code>&lt;p:column id="idSelectBox" selectionMode="multiple" style="width:68px"  /&gt;
  </code></pre>
  
  <p><strong>JQuery Code:</strong></p>
  
  <pre><code>function countChecked() {   
      var n = $("input:checkbox:checked").length;   
      alert('Count: ' + n);
  } 
  
  $(":checkbox").click(countChecked);
  </code></pre>
  
  <p>Hope you can help me out!</p>
  
  <p><strong>UPDATE 1:</strong></p>
  
  <p>I did a little more research and the Primefaces component does not render to HTML checkboxes elements, its outputs is a set of divs and classes:</p>
  
  <pre><code>&lt;td class="ui-selection-column"&gt;
   &lt;div class="ui-dt-c"&gt;
    &lt;div class="ui-radiobutton ui-widget"&gt;
     &lt;div class="ui-radiobutton-box ui-widget ui-corner-all ui-radiobutton-relative ui-state-default"&gt;
      &lt;span class="ui-radiobutton-icon"&gt;&lt;/span&gt;
     &lt;/div&gt;
    &lt;/div&gt;
   &lt;/div&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>So I'm still trying to figure out how I can detect whether the checkbox was checked or not.</p>