You need to sign in to do that
Don't have an account?
Abhishek Sharma 527
checkbox with records in visualforce
Hello There, I have created visualforce page which returns account records, I need checkbox in the result page along with records, 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];
}
}
// 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];
}
}
thanks.
All Answers
Check below working examples that can help you.
https://www.salesforcetutorial.com/use-apexcheckbox-tag/
https://www.biswajeetsamal.com/blog/how-to-retain-and-display-the-checkbox-selection-in-visualforce-paging/
Please mark as Best Answer if above information was helpful.
Thanks,
thanks.