You need to sign in to do that
Don't have an account?
Abhishek Sharma 527
Editable records in visualforce
Hello Folks, I have created Visualforce page which shows records of account and it's editable also there's checkbox but now requirement is to make records editable only when checkbox is checked, for example if i check 3 checkbox out of 10 records then only those 3 should be editable.
can anyone help in fufilling this requirement.
//my VF code
<apex:page standardController="account" sidebar="false" recordSetVar="records">
<apex:form>
<apex:pageBlock>
<apex:pageBlockTable value="{!records}" var="rec">
<apex:column headervalue="checkbox">
<apex:inputCheckbox/>
</apex:column>
<apex:column>
<apex:outputField label="name" value="{!rec.name}"/>
<apex:facet name="header">Account name</apex:facet>
</apex:column>
<apex:column>
<apex:outputField label="industry" value="{!rec.industry}"/>
<apex:facet name="header">Industry</apex:facet>
</apex:column>
<apex:inlineEditSupport event="ondblclick"/>
</apex:pageBlockTable>
<apex:pageBlockButtons location="Bottom">
<apex:commandButton value="Save" action="{!save}" id="saveButton"/>
<apex:commandButton value="Edit" action="{!save}" id="editButton"/>
<apex:commandButton value="Cancel" action="{!cancel}" id="delButton"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
can anyone help in fufilling this requirement.
//my VF code
<apex:page standardController="account" sidebar="false" recordSetVar="records">
<apex:form>
<apex:pageBlock>
<apex:pageBlockTable value="{!records}" var="rec">
<apex:column headervalue="checkbox">
<apex:inputCheckbox/>
</apex:column>
<apex:column>
<apex:outputField label="name" value="{!rec.name}"/>
<apex:facet name="header">Account name</apex:facet>
</apex:column>
<apex:column>
<apex:outputField label="industry" value="{!rec.industry}"/>
<apex:facet name="header">Industry</apex:facet>
</apex:column>
<apex:inlineEditSupport event="ondblclick"/>
</apex:pageBlockTable>
<apex:pageBlockButtons location="Bottom">
<apex:commandButton value="Save" action="{!save}" id="saveButton"/>
<apex:commandButton value="Edit" action="{!save}" id="editButton"/>
<apex:commandButton value="Cancel" action="{!cancel}" id="delButton"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
try with below code.
VF Page:
Apex Class:
If this helps, Please mark it as best answer.
Thanks!!
All Answers
Refer the below link will help you to resolve the issue.
https://cloudyvipin.wordpress.com/2017/02/16/inline-edit-record-when-checkbox-checked-on-visualforce-page/
If still facing an issue, let me know will help you with code.
Thanks!!
try with below code.
VF Page:
Apex Class:
If this helps, Please mark it as best answer.
Thanks!!
Thank you very much