How to use <h:selectBooleanCheckbox> in <h:dataTable> or <ui:repeat> to select multiple items?
问题 I have a Facelets page with a <h:dataTable> . In each row there is a <h:selectBooleanCheckbox> . If the checkbox is selected the object behind the corresponding row should be set in the bean. How do I do this? How to get the selected rows or their data in a backing bean? Or would it be better to do it with <h:selectManyCheckbox> ? 回答1: Your best bet is to bind the h:selectBooleanCheckbox value with a Map<RowId, Boolean> property where RowId represents the type of the row identifier. Let's