Activity › Forums › Salesforce® Discussions › What is the use of apex:facet in Salesforce Visualforce?
Tagged: apex:facet, Salesforce Apex, Salesforce Apex Code, Salesforce Visualforce Page, Visualforce Component
-
What is the use of apex:facet in Salesforce Visualforce?
Posted by kapil on March 15, 2018 at 12:49 PMWhat is the use of apex:facet in Visualforce?
Archit replied 8 years, 2 months ago 3 Members · 2 Replies -
2 Replies
-
Hi kapil,
A placeholder for content that is rendered in a specific part of the parent component, such as the header or footer of an
< apex:dataTable >.
An < apex:facet > component can only exist in the body of a parent component if the parent supports facets. The name of the facet component must match one of the pre-defined facet names on the parent component. This name determines where the content of the facet component is rendered. Consequently, the order in which a facet component is defined within the body of a parent component does not affect the appearence of the parent component.
Example:
<apex:page standardController=”Account”>
<apex:pageBlock title=”Contacts”>
<apex:dataTable value=”{!account.Contacts}” var=”contact” cellPadding=”4″ border=”1″>
<apex:column >
<apex:facet name=”header”>Name</apex:facet>
{!contact.Name}
</apex:column>
<apex:column >
<apex:facet name=”header”>Phone</apex:facet>
{!contact.Phone}
</apex:column>
</apex:dataTable>
</apex:pageBlock>
</apex:page>
- [adinserter block='9']
-
Hello Kapil,
<apex:facet> a Visualforce Component that are use to display the specific part of parent component such as header and footer of <apex:dataTable>.
Thanks!
Log In to reply.