Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Component Class

Represents a dynamic Visualforce component in Apex.

Namespace

ApexPages

Dynamic Component Properties

The following are properties for Component.

childComponents

Returns a reference to the child components for the component.

Signature

public List <ApexPages.Component> childComponents {get; set;}

Property Value

Type: List<ApexPages.Component>

Example

1Component.Apex.PageBlock pageBlk = new Component.Apex.PageBlock();
2
3Component.Apex.PageBlockSection pageBlkSection = new Component.Apex.PageBlockSection(title='dummy header');
4
5pageBlk.childComponents.add(pageBlkSection);

expressions

Sets the content of an attribute using the expression language notation. The notation for this is expressions.name_of_attribute.

Signature

public String expressions {get; set;}

Property Value

Type: String

Example

1Component.Apex.InputField inpFld = new 
2Component.Apex.InputField();
3inpField.expressions.value = '{!Account.Name}';
4inpField.expressions.id = '{!$User.FirstName}';

facets

Sets the content of a facet to a dynamic component. The notation is facet.name_of_facet.

Signature

public String facets {get; set;}

Property Value

Type: String

Usage

This property is only accessible by components that support facets.

Note

Example

1Component.Apex.DataTable myDT = new 
2Component.Apex.DataTable();
3Component.Apex.OutputText footer = new 
4Component.Apex.OutputText(value='Footer Copyright');
5myDT.facets.footer = footer;