I have VF page where I have displayed Contact information in pageBlockSection with mode="inlineEdit" as below..

<apex:page standardController="Contact" extensions="ContactDetailController" tabStyle="My_Contacts__tab" >
        <apex:pageBlock title="{!contact.name}" mode="inlineEdit" html-style="background-color: white;!important;">
                <apex:commandButton action="{!saveContact}" value="Save" reRender="contact" status="loading" />
                <apex:commandButton action="{!cancelChanges}" value="Cancel" reRender="contact" status="loading" />
            <apex:pageBlockSection title="Contact Information" columns="3" html-style="white-space:nowrap;!important; background-color: white;!important;" id="contact">
                <apex:outputField value="{!contact.Name}" />
                <apex:outputField value="{!contact.DoNotCall}" />
                <apex:outputField value="{!contact.AssistantName}" />

I have written save method in my extension controller 'ContactDetailController' as below

public Pagereference saveContact() {
    // contact = (Contact) sController.getRecord();
    upsert sController.getRecord();    
    return null;
public Pagereference cancelChanges() {    
    return null;

The issue I am facing is , The value I edit is getting saved only if I click somewhere else in the page before clicking save button. If I edit a value and click on 'Save' button without clicking anywhere , values are not getting persisted.

This occurs even in pageBlockTable with inlineEdit. But in a Standard SFDC page I see it working properly. How to get it working in my VF page also?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.