You are previewing Visualforce Development Cookbook - Second Edition.
O'Reilly logo
Visualforce Development Cookbook - Second Edition

Book Description

Discover over 70 real-world examples to overcome the most complex concepts you will face developing with Visualforce

About This Book

  • This book provides an enhanced user experience with dynamically-generated, reactive pages

  • Access data over additional channels via public web sites and mobile pages

  • Packed with easy-to-follow recipes, including step-by-step instructions and Apex/Visualforce code downloads this title is the all in one package you need to get more from Visualforce.

  • Who This Book Is For

    This book will be beneficial to developers who are already well-versed with the basics of Visualforce. An awareness of the standard component library and the purpose of controllers is expected.

    What You Will Learn

  • Pass parameters between Visualforce pages

  • Update attributes in component controllers

  • Avoid validation errors with action regions

  • Refresh record details from embedded Visualforce

  • Create and develop a website template from scratch

  • Get to know about the Salesforce Lightening Design system and use Visualforce in Salesforce1

  • Effectively tackle frequently-faced problems while developing Visualforce pages

  • In Detail

    Visualforce is a framework that allows developers to build sophisticated, custom user interfaces that can be hosted natively on the Force.com platform. The Visualforce framework includes a tag-based markup language, similar to HTML that is used to write the Visualforce pages and a set of controllers that are used to write business logic to the Visualforce pages.

    Visualforce Development Cookbook provides solutions to a variety of challenges faced by Salesforce developers and demonstrates how easy it is to build rich, interactive pages using Visualforce. Whether you are looking to make a minor addition to the standard page functionality or override it completely, this book will provide you with the help you require throughout.

    You will start by learning about the simple utilities and will build up to more advanced techniques for data visualization and to reuse functionality. You will learn how to perform various tasks such as creating multiple records from a single page, visualizing data as charts, using JavaScript to enhance client-side functionality, building a public website, and making data available to a mobile device.

    With an interesting chapter on tackling common issues faced while developing Visualforce pages, the book provides lots of practical examples to enhance and extend your Salesforce user interface.

    Style and approach

    Following a cookbook structure, the book provides recipes on some essential technical scenarios and a few that focus on real-world development problems. This book is packed with illustrations and contains lots of code samples to improve your understanding.

    Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

    Table of Contents

    1. Visualforce Development Cookbook - Second Edition
      1. Visualforce Development Cookbook - Second Edition
      2. Credits
      3. About the Author
      4. About the Reviewer
      5. www.PacktPub.com
        1. eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      6. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      7. 1. General Utilities
        1. Introduction
        2. Overriding standard buttons
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Data-driven styling
          1. How to do it...
          2. How it works...
          3. See also
        4. Turning off an action poller
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        5. Visualforce in the sidebar
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        6. Passing parameters to action methods
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Reacting to URL parameters
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        8. Passing parameters between Visualforce pages
          1. How to do it...
          2. How it works...
          3. See also
        9. Opening a pop-up window
          1. How to do it...
          2. How it works...
          3. See also
        10. Adding a launch page
          1. How to do it...
          2. How it works...
        11. Testing a custom controller
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        12. Testing a controller extension
          1. How to do it...
          2. How it works...
          3. See also
      8. 2. Custom Components
        1. Introduction
        2. Passing attributes to components
          1. How to do it...
          2. How it works...
          3. See also
        3. Updating attributes in component controllers
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Passing action methods to components
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        5. Data-driven decimal places
          1. How to do it...
          2. How it works...
          3. See also
        6. The custom iterator component
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Setting a value into a controller property
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        8. Multiselecting related objects
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Notifying the containing page controller
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
      9. 3. Capturing Data Using Forms
        1. Introduction
        2. Editing a record in Visualforce
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Adding error messages to field inputs
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Adding error messages to non-field inputs
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        5. Using field sets
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Adding a custom lookup to a form
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        7. Adding a custom datepicker to a form
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        8. Retrieving fields when a lookup is populated
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Breaking up forms with action regions
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        10. The Please wait spinner
          1. How to do it...
          2. How it works...
        11. Action chaining
          1. Getting ready
          2. How to do it...
          3. How it works...
      10. 4. Managing Records
        1. Introduction
        2. Styling fields as required
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Styling table columns as required
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Attaching an image to a record
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Managing attachments
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Maintaining custom settings
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Refreshing record details from embedded Visualforce
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Using wrapper classes
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        9. Changing options based on the user input
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        10. Changing page layout based on the user input
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        11. Form-based searching
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
      11. 5. Managing Multiple Records
        1. Introduction
        2. Editing a record and its parent
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Managing a list of records
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Converting a lead
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        5. Managing a hierarchy of records
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Inline editing a record from a list
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        7. Creating a Visualforce report
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Displaying report data in Visualforce
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Loading records asynchronously
          1. Getting ready
          2. How to do it...
          3. How it works...
      12. 6. Visualforce Charts
        1. Introduction
        2. Creating a bar chart
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Creating a line chart
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Customizing a chart
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Adding multiple series
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Creating a stacked bar chart
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        7. Adding a third axis
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        8. Embedding a chart in a record view page
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Multiple charts per page
          1. Getting ready
          2. How to do it...
          3. How it works...
      13. 7. Enhancing the Client with JavaScript
        1. Introduction
        2. Using action functions
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Avoiding race conditions
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. The confirmation dialog
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        5. Pressing Enter to submit
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. The onload handler
          1. How to do it...
          2. How it works...
          3. See also
        7. Collapsible list elements
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Trapping navigation away
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        9. Creating a record using JavaScript remoting
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
      14. 8. Force.com Sites
        1. Introduction
        2. Creating a site
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Record and field access
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Retrieving content from Salesforce
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        5. Web to lead form
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Creating a website template
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        7. Adding a header menu to a template
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        8. Adding a sidebar to a template
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        9. Conditional rendering in templates
          1. Getting ready...
          2. How to do it...
          3. How it works...
          4. See also
      15. 9. Visualforce in Salesforce1
        1. Introduction
        2. Navigating between pages
          1. How to do it...
          2. How it works...
        3. Lightning forms
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Capturing the user's location
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Saving an image when creating a record
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Capturing a signature when creating a record
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        7. Displaying a location in a map
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        8. Scanning the QR code to access the record
          1. Getting ready
          2. How to do it...
          3. How it works...
      16. 10. Troubleshooting
        1. Introduction
        2. Avoiding validation errors with action regions
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Surfacing errors
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Multiple bindings to the same record
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more ...
        5. Reducing view state size 1 - the transient keyword
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more ...
        6. Reducing view state size 2 - HTML vs Visualforce components
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more ...
        7. Debugging Visualforce
          1. How to do it...
          2. How it works...
          3. There's more ...
        8. Logging messages in a Visualforce page
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more