title: How to add a checkbox in pageblocktable row?
body: <p>I need to show all the custom object records in pageblocktable. Before populating all the records i need to add a picklist value, Checkbox in the first row and then populate all the records. How can i do that.</p>
  
  <pre><code>Name    Satisfy Opportunity            Status             Last modified                           
                                     Status(Picklist) 
          Turn on all checkbox     Turn on all checkbox   
               Clear all                Clear all 
  Test 1       Checkbox                 Checkbox             12/12/2014
  Test 2       Checkbox                 Checkbox             12/12/2014
  Test 3       Checkbox                 Checkbox             12/12/2014
  </code></pre>
  
  <p>VF code:</p>
  
  <pre><code>&lt;apex:page standardcontroller="Opportunity" extensions="oppgapstatus"&gt;
  &lt;apex:form&gt;
  &lt;apex:pageBlock&gt; 
  &lt;apex:pageBlockSection id="Info"&gt;
  &lt;apex:pageBlockTable value="{!WrapperList}" var="wraprec"&gt;
  &lt;apex:column value="{!wraprec.accRec.Name__c}"/&gt;
  &lt;apex:column value="{!wraprec.accRec.Satisfied__c}"/&gt;  
  &lt;apex:column value="{!wraprec.accRec.Current_Status__c}"/&gt;
  &lt;apex:column value="{!wraprec.accRec.LastModifiedDate}"/&gt;
  &lt;/apex:pageBlockTable&gt;
  &lt;/apex:pageBlockSection&gt;
  &lt;apex:commandbutton value="Save" action="{!UpdateSelectedRecords}"/&gt;
  &lt;apex:commandbutton value="Cancel"/&gt;
  &lt;/apex:pageBlock&gt;
  &lt;/apex:form&gt;
  &lt;/apex:page&gt;
  </code></pre>
  
  <p>Apex class:</p>
  
  <pre><code>Public class oppgapstatus{
   Public Opportunity optyList{get;set;}
   Public Opportunity_Status__c opst{get;set;}
    public PageReference openPresentationOptions() {
        return null;
     }
  
   private ApexPages.StandardController controller;
   public oppgapstatus(ApexPages.StandardController controller) {
   }
  //Checkbox selectall        
  Public List&lt;wrapperclass&gt; wrapList {get;set;}
  Public boolean checked{get;set;}
  Public string selectedField {get;set;}
  Public string inputVal{get;set;}
    Public void selectallnone(){
      if(!checked)
        checked = true;
      else
        checked = false;
  
   }
    Public List&lt;wrapperclass&gt; getWrapperList(){
     wrapList = New List&lt;wrapperclass&gt;();
     for(Opportunity_Status__c acc:[select name,Satisfied__c,Current_Status__c,LastModifiedDate from Opportunity_Gaps__c where Opportunity_Detail__c =: optyList.Id]){
       if(!checked)
       wrapList.add(New wrapperclass(acc,false)); 
       else
       wrapList.add(New wrapperclass(acc,true));   
     } 
     return wrapList; 
    }
     Public class wrapperclass{
     Public Opportunity_Status__c accRec{get;set;}
     Public boolean checkFlag{get;set;}
  
     Public wrapperclass(Opportunity_Status__c acc,boolean flag){
      accRec = acc;
      checkFlag = flag;
      }
     }
  </code></pre>
  
  <p>Can anyone help me..thanks in advance</p>