Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!

Jemah Sam

Greenhorn
+ Follow
since Apr 10, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jemah Sam

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.
checkbox1 - documentId = 1
checkbox2 - documentId = 2
checkbox3 - documentId = 3
checkbox4 - documentId = 4

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>

---- Bean -----
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, how to check the checkbox1 & 4?
   }
2 weeks ago