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

Component.Apex.PageBlock pageBlk = new Component.Apex.PageBlock();

Component.Apex.PageBlockSection pageBlkSection = new Component.Apex.PageBlockSection(title='dummy header');

pageBlk.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

Component.Apex.InputField inpFld = new 
Component.Apex.InputField();
inpField.expressions.value = '{!Account.Name}';
inpField.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

Component.Apex.DataTable myDT = new 
Component.Apex.DataTable();
Component.Apex.OutputText footer = new 
Component.Apex.OutputText(value='Footer Copyright');
myDT.facets.footer = footer;