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. ...

Get Visualforce Development Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.