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
Parteek Goyal 3Parteek Goyal 3 

How to use checkbox on visualforce page

Hi All,

I am showing Account List on visualforce page using pageblocktable tag. I want to Add checkbox in front of every record. For this i did use <apex:inputcheckbox> tag but checkbox is not showing on page.

Please help me...
Best Answer chosen by Parteek Goyal 3
SunidharSunidhar
You have to use wrapper class, and there u need to store checkbox and account records in one wrapper list
 

All Answers

SunidharSunidhar
U must use that tag inside column tag of page block table

<apex:page>
<apex:pageBlock>
<apex:pageBlockTable>
<apex:column>
<apex:inputCheckBox value="{!variableName}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

If it sloves ur issue please mark it as Best Answer
Parteek Goyal 3Parteek Goyal 3
Hi bsunidhar,

your solution is working prefectly but i want to know one more thing...
let suppose i want to delete multipe record selecting multiple checkbox then how can i do this in my controller.
Please help me...
SunidharSunidhar
You have to use wrapper class, and there u need to store checkbox and account records in one wrapper list
 
This was selected as the best answer