I have a rich:extendeddatatable and I'm not using selection attribute to select rows. Each row I have a checkbox but I want a general checkbox above the list to select all the rows.
When I clicked on the main checkbox, the other checkboxes in the datatable didn't selected.
Can somebody help with this? Thanks! (I am not using js, it's pure java but nothing else)
I tried like this:
<div>
<h:selectBooleanCheckbox value="#{bean.status}" action="#{bean.checked}" />
</div>
And my function in the bean is like this: Boolean selected=false;
public void checked(){
if(this.selected){
setSelected(false);
selectAll(false);
}
else{
setSelected(true)
selectAll(true);
}
}
// and for selectAll() func. i'm setting my status value (which I assigned as a value to the checkbox in my datatable), also I am running that search query to rerender the extendeddatatable