Example of In-line Edit in Visualforce Page

What will you do in this Example??

  1. You will create a visualforce page.
  2. Use contact or any object as standard controller.
  3. Use page block table component with mandatory attributes.
  4. In last line of page block table use inlineeditSupport Component.
Example:

****** Visualforce Page **********


<apex:page standardController="Contact" recordSetVar="Con">
  <apex:form >
      <apex:pageBlock title="List of Contacts">
          <apex:pageBlockTable value="{!Con}" var="c" rows="10">
              <apex:column value="{!c.firstname}"/>
              <apex:column value="{!c.lastname}"/>
              <apex:column value="{!c.phone}"/>
              <apex:column value="{!c.fax}"/>
              <apex:column value="{!c.title}"/>
              <apex:column value="{!c.email}"/>
              <apex:inlineEditSupport />
          </apex:pageBlockTable>
          <apex:pageblockButtons >
              <apex:commandButton value="First" action="{!First}"/>
              <apex:commandButton value="Previous" action="{!Previous}"/>
              <apex:commandButton value="Next" action="{!Next}"/>
              <apex:commandButton value="Last" action="{!Last}"/>
              <apex:commandButton value="Save" action="{!QuickSave}"/>
          </apex:pageblockButtons>
      </apex:pageBlock>
  </apex:form>
</apex:page>



Comments