Hi everybody, I have a datatable with checkboxes in one colum and a datascroller.
I want a checkbox that selects all checkboxes in the column.
So I tried to code that with jQuery and I did the following:
... <rich:dataTable id="dataTable" var="item" value="#{principalHandler.rows}" binding="#{principalHandler.dataTable}" rows="10"> <h:column> <f:facet name="header"> <h:selectBooleanCheckbox id="selectAllItemsChbk" value="#{principalHandler.allRowsSelected}"> </h:selectBooleanCheckbox> </f:facet> <h:selectBooleanCheckbox id="selectItemChbk" value="#{item.selected}"/> </h:column> <h:column>....</h:column> </rich:dataTable> <rich:jQuery id="selectAllScript" selector="input[id][name$=\'selectAllItemsChbk\']" query="click(function(){ var value = (jQuery(selector).attr('checked') == true ? 'checked' : ''); jQuery('input[id][name$=\'selectItemChbk\']').attr('checked', value); });"/> <rich:datascroller id="resultsScroller" for="dataTable" maxPages="9"> </rich:datascroller> ...