Friday, 7 September 2012

Add a Custom Component to a Visualforce Page - Visualforce


You can now use and reference the component you created in the previous lesson much like any standard Visualforce component. The only difference is that instead of usingapex: in the name of the component, you use c:
  1. Create a new Visualforce page called custom.
  2. Use the following as the body of the page:
    <apex:page>
        <c:boxedText borderWidth="1" text="Example 1"/>
        <c:boxedText borderWidth="20" text="Example 2"/>
    </apex:page>
The page simply references the component you created in the previous lesson, twice, each time with different values in the attributes:

A Red Custom Component
Your custom components are automatically added to the help. Click Component Reference and scroll down to <c:boxedText>.

No comments:

Post a Comment