You need to sign in to do that
Don't have an account?
King Koo
InlineEditSupport not showing Save when there are validation errors...?
Hi there
Have a very simple sample here
As you can see there is a Date field which supports inline edit.
When you double click the field, the Save and Cancel buttons show. Now if I enter some bad data into the Date field, such as "abc", and click Save, it'll fail the validation rule.
It's obvious because the error displays in the <apex:pageMessages/> tag, but I cannot find a way to show the "Save" and "Cancel" buttons anymore.
Anyone knows what I'm missing here?
Thanks
King
Have a very simple sample here
<apex:page standardController="Contact"> <apex:form > <apex:pageMessages/> <apex:pageBlock mode="inlineEdit"> <apex:pageBlockButtons > <apex:commandButton action="{!edit}" id="editButton" value="Edit" style="display: none;"/> <apex:commandButton action="{!save}" id="saveButton" value="Save" style="display: none;"/> <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel" style="display: none;"/> </apex:pageBlockButtons> <apex:pageBlockSection > <apex:outputField value="{!contact.date__c}"> <apex:inlineEditSupport showOnEdit="saveButton, cancelButton" hideOnEdit="editButton" event="ondblclick" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/> </apex:outputField> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
As you can see there is a Date field which supports inline edit.
When you double click the field, the Save and Cancel buttons show. Now if I enter some bad data into the Date field, such as "abc", and click Save, it'll fail the validation rule.
It's obvious because the error displays in the <apex:pageMessages/> tag, but I cannot find a way to show the "Save" and "Cancel" buttons anymore.
Anyone knows what I'm missing here?
Thanks
King
Try the following workaround(checked this on my test ORG):
<apex:page standardController="contact">
<apex:form id="productForm">
<apex:pageBlock mode="inlineEdit" >
<apex:pageBlockButtons >
<apex:commandButton id="saveChanges" reRender="productForm" action="{!quicksave}" value="Save Changes" styleClass="saveChangesButton" />
</apex:pageBlockButtons>
<apex:pageBlockSection >
<apex:outputField value="{!contact.Check_date__c}">
<apex:inlineEditSupport showOnEdit="saveButton, cancelButton"
hideOnEdit="editButton" event="onclick"
changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
</apex:outputField>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Thanks for your reply.
But the focus is not about the date field, it's about Save and Cancel don't show anymore.
I can replace that date field with a numeric field and enter abc and Save. Same situation - error message displays but Save and Cancel don't.
Thanks
King