Skip to main content
I am trying to display list of Accounts using Standard controller and allow inline edit of records displayed. The Save button I have added is not working/saving the udpate in database. Can someone please help, what m I missing

Do I need to write extension for this?

Code piece:

<apex:page standardController="Account" recordSetVar="Account">  <!-- extensions="myControllerExtension"> -->

    <apex:form >

    <apex:pageBlock title="Account Summary" mode="inlineEdit">

    <apex:inlineEditSupport showOnEdit="saveButton, cancelButton" 

                        hideOnEdit="editButton" event="ondblclick" 

                        changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>

                        

                <apex:commandButton action="{!quicksave}" id="saveButton" value="Save" rendered="true"/>

                <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel" rendered="true"/>

  <apex:pageBlockTable value="{! Account}" var="at">

            <apex:column value="{! at.Name }"/>

            <apex:column value="{! at.Phone}"/>

            <apex:column value="{! at.Industry}"/>

            <apex:column value="{! at.AnnualRevenue }"/>

            <apex:column value="{! at.Id }"/>

        </apex:pageBlockTable>

    </apex:pageBlock>

     </apex:form>

</apex:page>
4 respuestas
  1. 12 jun 2018, 07:57
    Hi,

    Use this code in your pageblocktable:

    <apex:pageBlockTable value="{! Account}" var="at">

    <apex:column headerValue="Name" >

    <apex:outputField value="{! at.Name}" />

    </apex:column>

    <apex:column headerValue="Phone" >

    <apex:outputField value="{! at.Phone}" />

    </apex:column>

    <apex:column headerValue="Industry" >

    <apex:outputField value="{! at.Industry}" />

    </apex:column>

    <apex:column headerValue="AnnualRevenue" >

    <apex:outputField value="{! at.AnnualRevenue}" />

    </apex:column>

    <apex:column headerValue="Account ID" >

    <apex:outputField value="{! at.Id}" />

    </apex:column>

    </apex:pageBlockTable>

     
0/9000