title: row selection on selection checkbox datatable primefaces
body: <blockquote>
    <p>we  need to fire ajax event on row selection on toggle of checkbox..i
    tried to find example but they are only doing row selection on click
    of p:command button.we are using primefaces 2.2</p>
  </blockquote>
  
  <p>Code</p>
  
  <pre><code>&lt;p:dataTable id="insList" var="insured"
                          value="#{policyHandler.insuredList}" paginator="true"
                          rows="#{label.insuredList_defaultNumberOfRows}"
                          paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                          rowsPerPageTemplate="#{label.insuredList_numberOfRows}"
                          style="width: 98%;" selection="#{policyHandler.inquiryInsureds}"&gt;                           &lt;!--&lt;p:column&gt;
                              &lt;f:facet name="header"&gt;
                                  &lt;h:outputLabel value="Select" /&gt;
                              &lt;/f:facet&gt;
                              &lt;h:selectBooleanCheckbox id="selection"
                                  value="#{insured.status}"&gt;
                                  &lt;p:ajax event="click" update="insuredOrder, selection" /&gt;
                              &lt;/h:selectBooleanCheckbox&gt;
                          &lt;/p:column&gt;
                          --&gt;
                          &lt;p:column selectionMode="multiple" /&gt;  
                          &lt;p:column&gt;
                              &lt;f:facet name="header"&gt;
                                  &lt;h:outputLabel value="Sequence" /&gt;
                              &lt;/f:facet&gt;
                              &lt;p:cellEditor id="insuredOrder" disabled="#{!insured.status}"&gt;
                                  &lt;f:facet name="output"&gt;
                                      &lt;h:outputText value="#{insured.sequence}" /&gt;
                                  &lt;/f:facet&gt;
                                  &lt;f:facet name="input"&gt;
                                      &lt;p:inputText value="#{insured.sequence}" /&gt;
                                  &lt;/f:facet&gt;
                              &lt;/p:cellEditor&gt;
                                  &lt;p:rowEditor /&gt;
                          &lt;/p:column&gt;
                          &lt;p:column headerText="Name"
                              sortBy="#{insured.generalPartyInfo.nameInfo.commlName.commercialName}"
                              filterMatchMode="contains" style="text-align:center;"&gt;
                              &lt;h:outputText
                                  value="#{insured.generalPartyInfo.nameInfo.commlName.commercialName}" /&gt;
                          &lt;/p:column&gt;
                          &lt;p:column sortBy="#{insured.generalPartyInfo.addr.city}"
                              style="text-align:center;"&gt;
                              &lt;f:facet name="header"&gt;
                                  &lt;h:outputLabel value="Street Address" /&gt;
                              &lt;/f:facet&gt;
                              &lt;h:outputText value="#{insured.generalPartyInfo.addr.city}" /&gt;
                          &lt;/p:column&gt;
                          &lt;p:column sortBy="#{insured.generalPartyInfo.addr.city}"
                              style="text-align:center;" width="10%"&gt;
                              &lt;f:facet name="header"&gt;
                                  &lt;h:outputLabel value="#{label.city}, #{label.state} " /&gt;
                                  &lt;h:outputLabel value=" #{label.postalcode}" /&gt;
                              &lt;/f:facet&gt;
                              &lt;h:outputText
                                  value="#{insured.generalPartyInfo.addr.city}, #{insured.generalPartyInfo.addr.stateProv} #{insured.generalPartyInfo.addr.postalCode}" /&gt;
                          &lt;/p:column&gt;
                          &lt;p:column headerText="Policy Type"&gt;
                              &lt;h:outputText value="#{insured.policyType}" /&gt;
                          &lt;/p:column&gt;
                          &lt;p:column headerText="Action" style="text-align:center;"&gt;
                              &lt;p:commandLink&gt;
                                  &lt;h:outputText value="Change" /&gt;
                              &lt;/p:commandLink&gt;
                          &lt;/p:column&gt;
                      &lt;/p:dataTable&gt;
  </code></pre>