You need to sign in to do that
Don't have an account?

Automatically checking a box in a pageblocktable for multiple records
I have setup a VF edit page to show all of the contacts related to the selected account in a pageblockTable. On this page I have a checkbox built in to not be visible and to automatically be checked, like the below:
<apex:inputcheckbox value="{!c.Create_Profile__c}" selected="true" style="visbility:hidden"/>
What I want to happen is this aforementioned Create_Profile__c field to be unchekced initially. However, once the user accesses this VF page it will automatically check the box upon save, without them having to consciously do this Unfortunately this is not happening right now. Even though I have added the attribute for "selected=true", it is not actually checking this box (side note: this same attribute works fine with a pageblockSection).
Can I not use the "selected" attribute on a inputcheckbox when using a pageblockTable?
Hi,
You can check checkbox on the page load in the page block table. You will have to pass the true value by the property for the check boxes.
For the reference use the below code
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
All Answers
Hi,
You can check checkbox on the page load in the page block table. You will have to pass the true value by the property for the check boxes.
For the reference use the below code
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
@S Jain
Your response did indeed help me get to the solution! All I needed to do was add a simple line for "contact.Create_Profile__c = true;", which I derived from the class you shared.
Thank you for the reply!!!