Javatpoint Logo
Javatpoint Logo

<apex: dynamicComponent> in Visualforce Page

The <apex: dynamicComponent> is a component tag used for our dynamic apex components. It acts as a placeholder and has one required parameter, i.e., componentValue. The componentValue is the name of the apex method that returns the dynamic component.

These are some of the following components which don't have dynamic Apex representations:

  • <apex: attribute>
  • <apex: component>
  • <apex: componentBody>
  • <apex: composition>
  • <apex: define>
  • <apex: dynamicComponent>
  • <apex: include>
  • <apex: insert>
  • <apex: param>
  • <apex: variable>

The <apex: dynamicComponent> has the following attributes:

1. componentValue

The componentValue is a UIComponent type attribute used for specifying the name of the apex method that returns the dynamic VF component.


2. id

The id is a string type attribute, i.e., a unique identifier that allows this component to be referenced by other components in the custom component definition.


3. invokeAfterAction

The id is a Boolean type attribute that specifies whether the componentValue's apex method is called after the page's or submit's action method is invoked.


4. rendered

The rendered is a Boolean type attribute that specifies whether this component needs to be rendered on the page or not. The boolean value true is set as a default value to this attribute.


Let's take an example to understand how we can use this component on the VF page:




apex: dynamicComponent in Visualforce Page

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA