Apex and Visualforce Controllers: Template Component - Salesforce Exam DEV-501

Template Component

Question

A template component that provides content for an <apex:insert> component defined in a Visualforce template page.

See also: <apex:composition>, <apex:insert>

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

D.

The correct answer is D. apex:define.

apex:define is a Visualforce component that defines a named area in a Visualforce template page that can be referenced by the apex:insert component.

Here's how it works:

  1. In a Visualforce template page, you use the apex:define component to define a named area. For example:

    php
    <apex:define name="myContent"> This is the content that will be inserted. </apex:define>
  2. In another Visualforce page that uses the template, you use the apex:insert component to reference the named area:

    lua
    <apex:insert name="myContent" />

    This will cause the content defined in the apex:define component in the template page to be inserted into the current page at the location of the apex:insert component.

The other options listed in the question are not related to defining content for a apex:insert component:

  • apex:facet is used to define areas in a Visualforce component where content can be inserted by the parent component.
  • apex:includeScript is used to include an external JavaScript file in a Visualforce page.
  • apex:axis is not a valid Visualforce component.

So, the correct answer is D. apex:define.