title: How to enable/disable item in selecManyCheckbox based on flag
body: <p>I need your help in disabling and enabling an item from the <code>selectManyCheckbox</code> component in a jsf page. First of all, the selectManyCheckbox component is showing three chechboxes which are (Loan - Health - Transfer). The list will be populated from a bean which it has the code:</p>
  
  <pre><code>private List&lt;hrCertificate&gt; hrCertificatesList = new ArrayList&lt;hrCertificate&gt;(); 
  
  //Getter and Setter
  
  Private String loanFlag="";
  
  @PostConstruct
  public void init() {
  
      this.hrCertificatesList.add(new hrCertificate(("Loan"), "LC"));
      this.hrCertificatesList.add(new hrCertificate(("Health"), "HI"));
      this.hrCertificatesList.add(new hrCertificate(("Trasnfer"), "TE"));    
  }
  </code></pre>
  
  <p>In the same bean, I will be running a SQL statement that will return either Yes or No and that value I am adding it to the <code>loanFlag</code> variable.So if the flag="Y", I need to enable the loan checkbox so the user can select it else I need to disable it from the <code>selectManyCheckbox</code>. The issue is that I am facing difficulties in applying the logic to disable and to enable the item <code>selectManyCheckbox</code>where in the above code I am listing and enabling them all the time.</p>
  
  <p>The code for the selectManyChexkbox:</p>
  
  <pre><code> &lt;p:selectManyCheckbox id="hrCertificates" value="#{user.selectedHRCertificates}" layout="pageDirectio&gt;
       &lt;f:selectItems value="#{user.hrCertificatesList}" 
           var="hrCertificate" itemLabel="#{hrCertificate.hrCertificateName}"
           itemValue="#{hrCertificate.hrCertificateCode}"/&gt;
  
   &lt;/p:selectManyCheckbox&gt;
  </code></pre>
  
  <p>So how to apply the logic</p>