• Brendan Conniff
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I'm experiencing a strange error with Salesforce's Inline Editing in a custom visualforce page. I have a sObject with a date field called Start_Date__c, and I have inline editing set up in the VisualForce like this:
<apex:page standardController="Product_Assignment__c"
    tabStyle="Product_Assignment__c"
    extensions="TestInlineEditControllerExt">

<apex:form id="productForm">
    <apex:pageBlock >
        <apex:pageMessages />
        <apex:pageBlockTable value="{!productAssignments}" var="productAssignment">
            <apex:column headerClass="h1">
                <apex:facet name="header">Start Date</apex:facet>
                <apex:outputField value="{!productAssignment.Start_Date__c}">
                    <apex:inlineEditSupport changedStyleClass="dirtyField" event="ondblclick" showOnEdit="saveChanges" />
                </apex:outputField>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
    <apex:commandButton id="saveChanges" reRender="productForm" action="{!quicksave}" value="Save Changes" styleClass="saveChangesButton" />
</apex:form>
</apex:page>
The custom controller is (this is not my exact code, but it's enough to replicate the issue):
public with sharing class TestInlineEditControllerExt {
    public List<Product_Assignment__c> productAssignments { get; set; }

    public TestInlineEditControllerExt(ApexPages.StandardController stdController) {
        stdController.addFields(new List<String> { 'Start_Date__c' });
        productAssignments = new List<Product_Assignment__c> {
            (Product_Assignment__c)stdController.getRecord()
        };
    }
}
This works well in normal use cases. If I edit the field an input a deliberately incorrect value (like 'abcdef'), and press save, I receive the expected error: Start Date: Invalid Date and Time.

After this, if I attempt to click the revert button and save again, I receive a cryptic error message: Start Date: Value cannot exceed 0 characters.

I've tried following this pattern on a standard detail page, but this issue only seems to happen on my custom visualforce page. I've also tried using a custom action (instead of "quicksave") on my controller, but have the same issue (error message, controller is never called). We do not have any validation rules in place for this field.

Does anybody know why this error is happening and how I can fix this issue? It seems to only happen when I have an inline editing component inside of an apex:pageBlockTable or apex:repeat element.
I'm experiencing a strange error with Salesforce's Inline Editing in a custom visualforce page. I have a sObject with a date field called Start_Date__c, and I have inline editing set up in the VisualForce like this:
<apex:page standardController="Product_Assignment__c"
    tabStyle="Product_Assignment__c"
    extensions="TestInlineEditControllerExt">

<apex:form id="productForm">
    <apex:pageBlock >
        <apex:pageMessages />
        <apex:pageBlockTable value="{!productAssignments}" var="productAssignment">
            <apex:column headerClass="h1">
                <apex:facet name="header">Start Date</apex:facet>
                <apex:outputField value="{!productAssignment.Start_Date__c}">
                    <apex:inlineEditSupport changedStyleClass="dirtyField" event="ondblclick" showOnEdit="saveChanges" />
                </apex:outputField>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
    <apex:commandButton id="saveChanges" reRender="productForm" action="{!quicksave}" value="Save Changes" styleClass="saveChangesButton" />
</apex:form>
</apex:page>
The custom controller is (this is not my exact code, but it's enough to replicate the issue):
public with sharing class TestInlineEditControllerExt {
    public List<Product_Assignment__c> productAssignments { get; set; }

    public TestInlineEditControllerExt(ApexPages.StandardController stdController) {
        stdController.addFields(new List<String> { 'Start_Date__c' });
        productAssignments = new List<Product_Assignment__c> {
            (Product_Assignment__c)stdController.getRecord()
        };
    }
}
This works well in normal use cases. If I edit the field an input a deliberately incorrect value (like 'abcdef'), and press save, I receive the expected error: Start Date: Invalid Date and Time.

After this, if I attempt to click the revert button and save again, I receive a cryptic error message: Start Date: Value cannot exceed 0 characters.

I've tried following this pattern on a standard detail page, but this issue only seems to happen on my custom visualforce page. I've also tried using a custom action (instead of "quicksave") on my controller, but have the same issue (error message, controller is never called). We do not have any validation rules in place for this field.

Does anybody know why this error is happening and how I can fix this issue? It seems to only happen when I have an inline editing component inside of an apex:pageBlockTable or apex:repeat element.