apex:page Component
The apex:page
component is a fundamental component in Visualforce that is used to define the attributes of a Visualforce page. It contains settings that define the behavior of the page, such as the page title, show header, sidebar, etc.
Syntax
The syntax of the apex:page
component is as follows:
<apex:page [attributes]>
<!-- page content -->
</apex:page>
Example
The following example shows a simple apex:page
component that sets the title of the page to "My Page":
<apex:page title="My Page">
<!-- page content -->
</apex:page>
Output
The above example will render a page with the title "My Page".
Explanation
The apex:page
component is used to define the attributes of a Visualforce page. The component can be used to set a variety of properties, such as the page title, show header, sidebar, etc. By default, Visualforce pages show a header and sidebar, but these can be hidden using the showHeader
and sidebar
properties.
Use
The apex:page
component is used to define the attributes of a Visualforce page. Some of the common properties that can be set using this component include:
title
: Sets the title of the page.showHeader
: Boolean value to hide or show the standard header.sidebar
: Boolean value to hide or show the sidebar.standardStylesheets
: Boolean value to include or exclude standard Salesforce stylesheets.
Important Points
- The
apex:page
component is always the outermost component in a Visualforce page. - Several attributes can be assigned to the
apex:page
component to define the behavior and layout of the page. - Custom CSS or JavaScript can be added to the page using the
style
andscript
attributes.
Summary
The apex:page
component is a fundamental component in Visualforce that is used to define the attributes of a Visualforce page. It contains settings that define the behavior of the page, such as the page title, show header, sidebar, etc. The component can be used to set a variety of properties, and custom CSS or JavaScript can be added to the page using the style
and script
attributes.