I am trying to select/unselect all checkboxes in the datatable using a single checkbox. As I am trying to set it on the server, I am unable to do so. I have looked around fo
It's because the ValueChangeEvent
occurs before the update model phase, so the value you change gets overwritten.
Do this in the public void selectAllComponents(ValueChangeEvent event)
if (event.getPhase() != PhaseId.INVOKE_APPLICATION) {
event.setPhase(PhaseId.INVOKE_APPLICATON);
event.queue();
} else {
//do your stuff here
}
Or just before your code add next line code in your original method
selectAll = (Boolean) event.getNewValue();