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:
Right-click on your project and navigate to New | Visualforce Component. The Create New Visualforce Component window appears, as shown in the following screenshot:
Enter the label and name for your new component. For this example, use
myComponent
.Select the API version for the page. For this example, keep it at the default value.
Click on Finish. A progress bar will appear followed by your new Visualforce component.
Just like pages, components can include HTML, CSS, JavaScript, and Visualforce tags. They...