Visualforce Workbook - ?? Download the Visualforce Cheat Sheet at . • Get in-depth documentation for Visualforce in the Visualforce Developer’s Guide. • Start learning the Apex

  • View
    216

  • Download
    3

Embed Size (px)

Text of Visualforce Workbook - ?? Download the Visualforce Cheat Sheet at . • Get in-depth documentation...

  • Version 5: Spring '13

    Visualforce Workbook

    Last updated: March 8, 2013

    Copyright 20002013 salesforce.com, inc. All rights reserved. Salesforce.com is a registered trademark of salesforce.com, inc., as are othernames and marks. Other marks appearing herein may be trademarks of their respective owners.

  • Table of Contents

    About the Visualforce Workbook..........................................................................................................1

    Tutorial #1: Creating and Listing Visualforce Pages...............................................................................3Step 1: Enable Visualforce Development Mode........................................................................................................................3Step 2: Create a Visualforce Page..............................................................................................................................................3Step 3: Edit the Visualforce Page..............................................................................................................................................4Step 4: Find all Visualforce Pages.............................................................................................................................................5Step 5: Alternative Page Creation.............................................................................................................................................5Summary...................................................................................................................................................................................5

    Tutorial #2: Adding Attributes and Using Auto-Suggest........................................................................6Step 1: Add Attributes Using Auto-Suggest.............................................................................................................................6Step 2: Add Additional Components........................................................................................................................................8Step 3: Add Nested Components..............................................................................................................................................9Summary...................................................................................................................................................................................9

    Tutorial #3: Understanding Simple Variables and Formulas.................................................................10Step 1: Global Variables..........................................................................................................................................................10Step 2: Basic Formulas............................................................................................................................................................10Step 3: Conditionals................................................................................................................................................................11Summary.................................................................................................................................................................................12

    Tutorial #4: Using Standard Controllers..............................................................................................13Step 1: Find Identifiers of Records..........................................................................................................................................13Step 2: Display Data from a Record........................................................................................................................................14Step 3: Display Other Fields...................................................................................................................................................15Step 4: Display Fields from Related Records..........................................................................................................................15Summary.................................................................................................................................................................................16

    Tutorial #5: Using Standard User Interface Components......................................................................17Step 1: Display a Record or Related Lists...............................................................................................................................17Step 2: Display Fields..............................................................................................................................................................17Step 3: Display a Table............................................................................................................................................................18Summary.................................................................................................................................................................................19

    Tutorial #6: Overriding and Pointing to Pages.....................................................................................20Step 1: Override the Standard Display for a Page...................................................................................................................20Step 2: Embed a Page on a Standard Layout..........................................................................................................................21Step 3: Create a Button that Links to a Visualforce Page.......................................................................................................21Step 4: Create Hyperlinks to URLs or Other Visualforce Pages.............................................................................................22Summary.................................................................................................................................................................................23

    Tutorial #7: Customizing User Interface Components.........................................................................24

    i

    Table of Contents

  • Step 1: Remove the Header and Sidebar.................................................................................................................................24Step 2: Style the HTML with CSS.........................................................................................................................................24Step 3: Iterate Using Unstyled Lists and Tables......................................................................................................................25Summary.................................................................................................................................................................................26

    Tutorial #8: Inputting Data with Forms..............................................................................................27Step 1: Create a Basic Form....................................................................................................................................................27Step 2: Show Field Labels.......................................................................................................................................................28Step 3: Display Warning and Error Messages.........................................................................................................................28Summary.................................................................................................................................................................................29

    Tutorial #9: Reusing Pages with Templates.........................................................................................30Step 1: Create a Template.......................................................................................................................................................30Step 2: Use a Template with Another Page............................................................................................................................30Step 3: Include One Visualforce Page within Another............................................................................................................31Summary.................................................................................................................................................................................31

    Tutorial #10: Creating and Using Custom Components.......................................................................32Step 1: Create a Simple Custom Component.........................................................................................................................32Step 2: Add a Custom Component to a Visualforce Page.......................................................................................................32Summary.................................................................................................................................................................................33

    Tutorial #11: Updating Visualforce Pages with Ajax.............................................................................34Step 1: Identify a Region for Dynamic Updates......................................................................................................................34Step 2: Add Dynamic Re-Rendering......................................................................................................................................34Summary...............................................................................................................