I want to implement select all checkbox into JSF h:datatable. This is the code if the h:datatable:
You can do something like this
in your js put this code
$(window).load(function () {
$(document).delegate(".checkall", "click", function(event) {
$(this).closest("table").find(':checkbox').attr('checked', this.checked);
});
});
b.t.w instead of storing in map you can add attribute to your iterated item like this: instead of value="#{SessionsController.selectedIds[item.aSessionID]}" something like this value="#{item.selected}"
and later on you can iterate over them in the server side and add to list that will be sent to you r delete method...