I ran into the same problem when I wanted to disable only certain lines from the selection (one or more) based on the bean property. The short answer for me was simply to hide the radio / checkbox on this line so that it could not be selected. My needs required that I be able to handle additional options at runtime. This meant that I had to be sure that the rows were not physically selected before any additional choices were made so that they were not reprocessed in subsequent processing, so do not forget about this condition.
Here is what I have done, for others who may stumble upon this question in the future.
1) In p: datatable, I added the rowStyleClass attribute and based on the bean criteria, providing a class, for example: 'select-selectable' or 'not-selectable'.
rowStyleClass="#{myBean.alreadyProcessedList.contains(item) ? 'not-selectable' : 'is-selectable'}"
In my execution process, the selected rows were added to this list, so they would be made "not selectable" after the form was displayed again after processing. Your initial load should contain unselectable lines that are already added to the list, or handle any condition that you need in your case.
2) Define CSS to make .not-selectable hide the radio / flag. Using "! Important" was necessary to override the inline style.
tr.not-selectable div.ui-radiobutton, tr.not-selectable div.ui-chkbox { visibility: hidden !important; }
source share