apex:variable

A local variable that can be used as a replacement for a specified expression within the body of the component. Use <apex:variable> to reduce repetitive and verbose expressions within a page.

Use this component to get user input for a controller method that does not correspond to a field on an sObject. Only <apex:inputField> and <apex:outputField> can be used with sObject fields.

Note: <apex:variable> does not support reassignment inside of an iteration component, such as <apex:dataTable> or <apex:repeat>. The result of doing so, e.g., incrementing the <apex:variable> as a counter, is unsupported and undefined.

Attribute NameAttribute TypeDescriptionRequired?API VersionAccess
idStringAn identifier that allows the component to be referenced by other components in the page. 10.0global
renderedBooleanA Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true. 10.0global
valueObjectThe expression that can be represented by the variable within the body of the variable component.Yes10.0global
varStringThe name of the variable that can be used to represent the value expression within the body of the variable component.Yes10.0global