function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Abhishek Sharma 527Abhishek Sharma 527 

checkbox in visualforce

Hello There, I have created visualforce page which returns account records, I need checkbox in the result page, can anyone plz guide how i can achieve that.

// my visualforce code

<apex:page controller="Demo2VF_Class">
<apex:form >
    <apex:pageBlock title="Account information">
        <apex:pageBlockTable value="{!acc}" var="item">
            <apex:column value="{!item.id}"/>
            <apex:column value="{!item.name}"/>
            <apex:column value="{!item.Type}"/>
            <apex:column value="{!item.rating}"/>
        
        </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:form>
</apex:page>

//my class code
public class Demo2VF_Class {
    
    public List<Account> acc{get;set;}
    
    public Demo2VF_Class(){
        acc = [Select id, name, Type, Account.Rating from Account];
      
        
    }
}
mukesh guptamukesh gupta
Hi Abhi,

Please follow below url:-

https://www.infallibletechie.com/2014/08/how-to-create-checkboxes-in-visualforce.html

 
if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh
Abhishek Sharma 527Abhishek Sharma 527
Thanks mukesh but My requirement is to have records with checkbox like this 
User-added image
can you plz advice on how to get this