4

I have created a Visualforce page for use on a standard Account page layout. I have my own custom controller extension defined.

The Visualforce page displays a series of fields (defined in a FieldSet) that are set up to use inlineEditSupport. The fields are rendered on the page via an apex:repeat.

<apex:pageBlock mode="inlineEdit">
        <apex:pageBlockButtons >
            <apex:commandButton action="{!InLineSave}" id="saveButton" value="Save" />
            <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel" />
        </apex:pageBlockButtons>
        <apex:outputPanel layout="block">
            <apex:outputText value="Last Updated on "></apex:outputText> 
            <apex:outputText value="{0,date,MM/dd/yyyy}">
                <apex:param value="{!DATEVALUE(Account.Last_Updated__c)}" />
            </apex:outputText>
        </apex:outputPanel>
        <div class="inlineEditSingleLine">
        <apex:pageBlockSection columns="1" title="My Section">
            <apex:repeat value="{!$ObjectType.Account.FieldSets.Inline_Edit_Fields}" var="f">
                <apex:outputField value="{!Account[f]}">
                    <apex:inlineEditSupport showOnEdit="saveButton,cancelButton" hideOnEdit="" event="ondblclick"
                    changedStyleClass="myBoldClass" resetFunction="resetInlineEdit" />
                </apex:outputField>
            </apex:repeat>
        </apex:pageBlockSection>
        </div>
    </apex:pageBlock>
</apex:form>

Everything works as expected when I edit a field and click the Save button. The Visualforce iFrame is refreshed and my data is displayed successfully on the page.

The issue comes when I edit the contents of one of those fields a second time. After clicking the Save button the second time, the page is posted back to the server, but this time all fields are blank.

If I refresh the entire page (rather than just the Visualforce iFrame) the data is once again displayed.

I have seen this behavior will all browsers I have tried (Chrome and Firefox).

Have I missed something obvious?

Edit: To add to the story, I went ahead and deployed all of the code to another environment (Full Sandbox) and I do not observe the issue. The page works as expected and may be saved multiple times in a row.

I am still interested in finding out why though.

1 Answer 1

1

It's hard to say. But considering that it works in another org, I'd suspect the difference in orgs would be the cause. Also worth looking at are the individual API versions for all files and if any files are not marked as Is Valid in your starting org.

In Develop|Apex Classes, make sure your view has the Is Valid field showing in the list. Check this value in both orgs to see if there are any differences. Recompiling all classes should refresh these if this is the problem.

Otherwise, it's possible that your starting org has triggers and/or workflows that could be interrupting the flow that don't exist in the working org.

Beyond this, I'd scratch my head and log a case.

1
  • Thanks for the thoughts Adam. At this point, I think creating a case is my best bet. Commented Sep 4, 2013 at 16:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .