Ads

Friday 3 May 2013

Component in Salesforce?

In Salesforce component is a reusable piece of code developed using Visual force and Apex controller.

Example:

<!-- Page -->

<apex:page>

    <c:myComponent myValue="My component's value" borderColor="red" />

</apex:page>


<!-- Component:myComponent -->     
<apex:component>

    <apex:attribute name="myValue" description="This is the value for the component."  type="String"required="true"/>

    <apex:attribute name="borderColor" description="This is color for the border."  type="String" required="true"/>

    <h1 style="border:{!borderColor}">

        <apex:outputText value="{!myValue}"/>

    </h1>

</apex:component>

No comments:

Post a Comment