I have 4 checkbox. I want to do pairing selection (select 1 checkbox then auto select another checkbox). checkbox1 will pair with checkbox4. checkbox2 will pair with checkbox3.
xhtml (will display 4 checkbox):
<p:dataTable id="popup1" var="comp1" rows="10"
value="#{ExaBackingBean.managedBean.popupcomp1List}"
editable="true"
selection="#{ExaBackingBean.managedBean.popupcomp1Select}"
emptyMessage="#{lbl['lbl.datatable.msg.no.records.found']}"
rowKey="#{comp1.documentId}" rowIndexVar="index">
<ac:paginator for="popup1"></ac:paginator>
<p:column style="width:3px;text-align:center;" >
<p:selectBooleanCheckbox value="#{comp1.selected}">
<p:ajax listener="#{ExaBackingBean.ckechboxSelectPairingAction(comp1.documentId)}" partialSubmit="true" process="@this" update="@([id$=CompChecklist])" />
</p:selectBooleanCheckbox>
</p:column>
public void ckechboxSelectPairingAction(int documentId) throws Exception {
System.out.println("documentId xxxxxxxxxxxx"+documentId);
if (documentId == 1) {
// ---> checkbox1 & checkbox4 should be selected, how to check the checkbox1 & 4?
} else if(documentId == 2) {
System.out.println("documentId kat dalam"+documentId);
// ---> checkbox2 & checkbox3 should be selected
}