Book Image

Visualforce Development Cookbook - Second Edition

By : Keir Bowden
Book Image

Visualforce Development Cookbook - Second Edition

By: Keir Bowden

Overview of this book

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.
Table of Contents (16 chapters)
Visualforce Development Cookbook - Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Passing attributes to components


Visualforce pages can pass parameters to components via attributes. A component declares the attributes that it is able to accept, including information about the type and whether the attribute is mandatory or optional. Attributes can be used directly in the component or assigned to properties in the component's controller.

Note

Note that since the Spring 13 release of Salesforce (API version 27.0) you may not assign an attribute to a controller property with the same name. Attempting to do this results in the following error when saving the component:  Error: <apex:attribute assignTo> cannot be same as the <apex:attribute name>

In this recipe, we will create a Visualforce page that provides contact edit capability. The page utilizes a custom component that allows the name fields of the contact, Salutation, First Name, and Last Name, to be edited in a three-column page block section. The contact record is passed from the page to the component as...