I have the following code:
<p:selectManyCheckbox id="contactrole"
value="#{contactDetail.contactRoles}"
required="#{}"
layout="grid"
columns="1"
disabled="#{!contactDetail.editMode}">
<f:selectItems value="#{contactDetail.contactRoleItems}"/>
<p:ajax event="change"
process="@this"
update="linked_relationship_detail"
listener="#{contactDetail.doSomething()}"/>
</p:selectManyCheckbox>
When I select or unselect checkboxes the doSomething()
method is executed, except when I unselect the last checkbox. So when there are no checkboxes selected this method is not called.
When I set the required attribute to false then the method is called. Until a certain point I understand this logic, but certain components in my view are rendered (or not) depending if there are checkboxes selected or not. So how can I know that there are no checkboxes selected anymore?