function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Preya VaishnaviPreya Vaishnavi 

Inline editing in visualforce pages using apex:inlineditsupport

Hi ,

 

  We tried to bring inline editing in visualforce pages using apex:inlineeditsupport tag .

 

Inline edit is working on fields but buttons are not visible (Save , Save&New , Cancel) on the top .

 

we gave id's of showonedit and hideonedit attribute in Apex:inlineeditsupport tag but stilll save button is not visible.

 

Is there a way to make a boolean true while inline edit using any attribute , so that the boolean can be used in the render condition of the save button inorder to make it visible .

 

Any help around this would be helpful ..

 

Note: we have overrided edit button

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Preya VaishnaviPreya Vaishnavi

Hi,

 

Thanks for the reply!!!!!!!!!!

 

We found out the solution for this..

 

Its by giving style="display:none" for the command button save...So that it ll be visible only during edit....

All Answers

sai.sfsai.sf

<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>
</apex:page>

Preya VaishnaviPreya Vaishnavi

Hi,

 

Thanks for the reply!!!!!!!!!!

 

We found out the solution for this..

 

Its by giving style="display:none" for the command button save...So that it ll be visible only during edit....

This was selected as the best answer