Newer Version Available
apex:attribute
A definition of an attribute on a custom component. The attribute tag can be a child of a component tag only.
Example
Attributes
| Attribute Name | Attribute Type | Description | Required? | API Version | Access |
|---|---|---|---|---|---|
| access | String | Indicates whether the attribute can be used outside of any page in the same namespace as the attribute. Possible values are "public" (default) and "global". Use global to indicate the attribute can be used outside of the attribute's namespace. If the access attribute on the parent apex:component is set to global, it must also be set to global on this component. If the access attribute on the parent apex:component is set to public, it cannot be set to global on this component. NOTE: Attributes with this designation are subject to the deprecation policies as described for managed packages in the appexchange. | 14.0 | ||
| assignTo | Object | A setter method that assigns the value of this attribute to a class variable in the associated custom component controller. If this attribute is used, getter and setter methods, or a property with get and set values, must be defined. | 12.0 | global | |
| default | String | The default value for the attribute. | 13.0 | global | |
| description | String | A text description of the attribute. This description is included in the component reference as soon as the custom component is saved. | 12.0 | global | |
| encode | Boolean | This is a temporary option to address an issue affecting some package installations. It will be removed in the next release. Do not use unless advised to do so by Salesforce. | 15.0 | ||
| id | String | An identifier that allows the attribute to be referenced by other tags in the custom component definition. | 12.0 | global | |
| name | String | The name of the attribute as it is used in Visualforce markup when the associated
custom component includes a value for the attribute.
|
Yes | 12.0 | global |
| required | Boolean | A Boolean value that specifies whether a value for the attribute must be provided when the associated custom component is included in a Visualforce page. If set to true, a value is required. If not specified, this value defaults to false. | 12.0 | global | |
| type | String |
The Apex data type of the attribute. If using the assignTo attribute to assign the value of this attribute to a controller class variable, the value for type must match the data type of the class variable. Only the following data types are allowed as values for the type attribute:
|
Yes | 12.0 | global |