Newer Version Available

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

apex:facet

A placeholder for content that's rendered in a specific part of the parent component, such as the header or footer of an <apex:dataTable>.

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:outfield can be used with sObject fields.

An <apex:facet> component can only exist in the body of a parent component if the parent supports facets. The name of the facet component must match one of the pre-defined facet names on the parent component. This name determines where the content of the facet component is rendered. The order in which a facet component is defined within the body of a parent component doesn't affect the appearance of the parent component.

See <apex:dataTable> for an example of facets.

Note: Although you can't represent an <apex:facet> directly in Apex, you can specify it on a dynamic component that has the facet. For example:

Component.apex.dataTable dt = new Component.apex.dataTable(); dt.facets.header = 'Header Facet';

Example

Attributes

Attribute Name Attribute Type Description Required? API Version Access
name String The name of the facet to be rendered. This name must match one of the pre-defined facet names on the parent component and determines where the content of the facet component is rendered. For example, the dataTable component includes facets named "header", "footer", and "caption". Yes 10.0 global