Newer Version Available

This content describes an older version of this product. View Latest

apex:composition

An area of a page that includes content from a second template page. Template pages are Visualforce pages that include one or more <apex:insert> components. The <apex:composition> component names the associated template, and provides body for the template's <apex:insert> components with matching <apex:define> components. Any content outside of an <apex:composition> component is not rendered.

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.

See also: <apex:insert>, <apex:define>

Example

The example above renders the following HTML:

Attributes

Attribute Name Attribute Type Description Required? API Version Access
rendered String

This attribute has no effect on the display of this component. If you wish to conditionally display a <apex:component> wrap it inside a <apex:outputPanel> component, and add the conditional expression to its rendered attribute.

10.0 global
template ApexPages.PageReference The template page used for this component. For this value, specify the name of the Visualforce page or use merge-field syntax to reference a page or PageReference. Yes 10.0 global