I am new to VF so I hope someone here can help me with a problem I have.
I have created a VF page where a checkbox determines if another field should be shown or not.
I wanted to use inline editing as well, but then I need to save for the field to show. Is is possible to make the rerender work when editing inline?
This is my code:
<apex:pageBlockSection title="Billing Information" >
<!-- The checkbox which decides who should be billed -->
<apex:outputField value="{!servicecontract.Invoices_should_be_issued_to_distributor__c}" id="theCheckbox">
<apex:actionSupport event="onchange" rerender="billingAddress"/>
</apex:outputfield>
</apex:pageBlockSection>
<apex:pageBlockSection id="billingAddress" columns="2" >
<apex:outputField id="distributorAccount" label="Distributor account" value="{!servicecontract.Distributor_Account__c}" rendered="{!(servicecontract.Invoices_should_be_issued_to_distributor__c == true)}" />
</apex:pageBlockSection>
<apex:inlineEditSupport event="ondblClick" hideOnEdit="editButton" />
Best Answer
Yes you can do that. It works fine like on any other page without inline edit support. Here a simple example how to implement this:
Controller:
Page:
A normal state without any editing:
Then editing the first field just to show that a new value will not disappear after rerender:
And now cklicking on the checkbox and the second field appears: