Hello,
I had a lot of problems with the same issue. I resolved in the next way:
Code:
<h:selectBooleanCheckbox id="checkAll">
<a4j:support event="onclick" action="selectMessageTree" onsubmit="checkUncheckAll(this)" reRender="#{flowRenderFragments}" />
</h:selectBooleanCheckbox>
And the javascript function, it checks or unchecks all the check box of the page (you can change only for the checkboxes of the table)
Code:
/**
* Check or uncheck all the check boxes of a view
* @param checkBoxGeneral
* @return
*/
function checkUncheckAll(checkBoxGeneral) {
var checkBoxGeneralState = checkBoxGeneral.checked;
if(checkBoxGeneralState) {
for(i=0; i<document.portalForm.elements.length; i++) {
if(document.portalForm.elements[i].type=="checkbox") {
document.portalForm.elements[i].checked = true;
}
}
}
else {
for(i=0; i<document.portalForm.elements.length; i++) {
if(document.portalForm.elements[i].type=="checkbox") {
document.portalForm.elements[i].checked = false;
}
}
}
}