Activity Forums Salesforce® Discussions What is the use of apex:facet in Salesforce Visualforce?

  • shariq

    Member
    July 28, 2017 at 12:46 pm

    Hi Shubham,

    You can refer to this link

  • Allie

    Member
    July 28, 2017 at 1:00 pm

    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. for more detail click this link

     

  • Parul

    Member
    September 17, 2018 at 6:41 am

    <apex:facet>:
    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.

  • shariq

    Member
    September 18, 2018 at 2:06 am

    Hi,

    Note: Although you can't represent an <apex:facet> directly in Apex, you can specify it on a dynamic component that has the facet. For example:

    Component.apex.dataTable dt = new Component.apex.dataTable(); dt.facets.header = 'Header Facet';

    <!-- For this example to render properly, you must associate the Visualforce page
    with a valid account record in the URL.
    For example, if 001D000000IRt53 is the account ID, the resulting URL should be:
    https://Salesforce_instance/apex/myPage?id=001D000000IRt53
    See the Visualforce Developer's Guide Quick Start Tutorial for more information. -->

    <!-- Shows a two column table of contacts associated with the account.
    The account column headers are controlled by the facets.-->

    <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>

     

  • Prachi

    Member
    September 18, 2018 at 1:21 pm

    hi,

    <apex:facet>:
    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 >.

    thanks

Log In to reply.

Popular Salesforce Blogs