Visualforce components

Once you have mastered the use of Visualforce pages, you will have probably written many useful snippets of markup that you use over and over. While it's easy to just copy and paste these snippets, you can be more efficient and take advantage of Visualforce components. Components are stored snippets of Visualforce markup that you can reference multiple times in a single page or across multiple pages.

You can create a Visualforce component in the Force.com IDE as follows:

  1. Right-click on your project and navigate to New | Visualforce Component. The Create New Visualforce Component window appears, as shown in the following screenshot:
  2. Enter the label and name for your new component. For this example, use myComponent.
  3. Select the ...

Get Learning Apex Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.