Javatpoint Logo
Javatpoint Logo

apex:include in Visualforce Page

The <apex: include> component is another important component in the Visualforce page that is used for inserting a new VF page into the current page. The entire page subtree is injected into the VF DOM at the point of reference, and the scope of the included page is maintained.

Instead of using the <apex: include> component, we use the <apex: composition> component when the content should be stripped from the included page.

The <apex: include> componenthas the following attributes:

1. id

The id is a string type attribute, i.e., a unique identifier that allows the inserted page to be referenced by other components in the page.

Syntax

2. pageName

The pageName is an ApexPages.PageReference type attribute, i.e., a VF page whose content needs to be inserted into the current page. The name of the Visualforce page is passed as a value to this attribute.

Syntax

3. rendered

The rendered is a Boolean type attribute that is used for specifying whether this component needs to be rendered on the page or not. By default, its value is set to true.

Syntax

Let's take an example to understand how we can use the <apex: include> component on the Visuaforce page:

ApexImageExample.vfp

ApexIncludeExample.vfp

Output

apex:include in Visualforce Page





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA