+ Start a Discussion
honda57honda57 

How can I make the fields on my VF page dynamically editable?

 

So I placed some fields on my VF page with a field set using:

 

<apex:repeat value="{!$ObjectType.Lead.FieldSets.QDR_Information}" var="f">
<apex:outputfield value="{!Lead[f]}">
</apex:outputfield>
</apex:repeat>

 

The only problem is that becuase I am using <apex:ouputfield>, the fields are not dynamically editable via double-click.  I want the same functionallity that we get with the standard UI.  Is that possible?

Andrew WilkinsonAndrew Wilkinson

Add inlineEditing...your controller would need to be an extension to the standardcontroller or you will need to use the standardconttroller.

 

<apex:outputField value="{!contact.lastname}">
                    <apex:inlineEditSupport showOnEdit="saveButton, cancelButton"  hideOnEdit="editButton"       event="ondblclick"  changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
</apex:outputField>