3

So I am try this sample directly from the developer guide, and if you were do an inline edit of the last name field, for example, and want to revert back to the original data by hitting cancel it doesn't do that.

Instead, it set the value to that field, but it is not saved into the record yet. Is that normal behavior? I was expecting to revert back to the original data from the record.

<apex:page standardController="Contact">
<apex:form >
    <apex:pageBlock mode="inlineEdit">
        <apex:pageBlockButtons >
            <apex:commandButton action="{!edit}" id="editButton" value="Edit"/>
            <apex:commandButton action="{!save}" id="saveButton" value="Save"/>
            <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection >
            <apex:outputField value="{!contact.lastname}">
                <apex:inlineEditSupport showOnEdit="saveButton, cancelButton" 
                    hideOnEdit="editButton" event="ondblclick" 
                    changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
            </apex:outputField>
            <apex:outputField value="{!contact.accountId}"/>
            <apex:outputField value="{!contact.phone}"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>

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.