This week's book giveaway is in the NodeJS forum.
We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line!
See this thread for details.
Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

I have 4 checkboxes. If c1 is selected then c4 will be auto selected.How can i do this in jsf?  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
   }
 
Squanch that. And squanch this tiny ad:
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!