Getting the resetInlineEdit function to work with inline edit support

I have the following visualforce page that I would like to use inline editing with.

<apex:page standardController="Account" extensions="customController" >
<apex:form id="theForm">
<apex:sectionHeader id="sectionHeader" title="Account" subtitle="{!Account.name}"/>  

<apex:pageBlock mode="maindetail" id="thePageBlock" >

    <apex:pageBlockButtons location="top" id="buttons">
        <apex:commandButton action="{!update}" id="saveButton" value="Update"/>
        <apex:commandButton onclick="resetinlineedit()" id="cancelButton" value="Cancel" />
    </apex:pageBlockButtons>

    <apex:pageBlockSection id="contactInfo" title="Contact Information" columns="2" collapsible="false">            
        <apex:outputField id="homePhone" value="{!Account.Home_Phone__c}"/>
        <apex:outputField id="primaryEmail" value="{!Account.Primary_Email__c}"/>
        <apex:outputField id="businessPhone" value="{!Account.phone}"/>
        <apex:outputField id="billingEmail" value="{!Account.Billing_Email__c}"/>
        <apex:outputField id="otherPhone" value="{!Account.Other_Phone__c}"/>
        <apex:outputField id="technicalEmail" value="{!Account.Technical_Email__c}"/>
        <apex:inlineEditSupport id="editSupport" event="ondblclick" />
    </apex:pageBlockSection>

</apex:pageBlock>
</apex:form>

What I want to happen is if a user changes a field and then hits the cancel button the fields in the page block section revert to what they were. As it is now clicking the cancel button removes the undo button, but keeps the entered values in the field.

Can anybody tell me why this is happening, and how to get the desired functionality?

Answer

I think the problem is that resetInlineEdit() appears to be missing (see also this question.) I tried running your code in my dev org and Firebug showed the following error:

ReferenceError: resetInlineEdit is not defined

Attribution
Source : Link , Question Author : Minutiae , Answer Author : Community

Leave a Comment