Thursday 6 September 2012

Display Fields - - Using Standard User Interface Components - Visualforce

If you want to selectively determine a record’s fields for display, use the <apex:outputField> component. This component, when embedded in the <apex:pageBlock> component, displays not only the value of the field, but also the field’s label.
  1. Insert the following into your page to see it in action:
    <apex:pageBlock title="Custom Output">
        <apex:pageBlockSection title="Custom Section Title">
            <apex:outputField value="{!account.Name}"/>
            <apex:outputField value="{!account.Owner.Name}"/> </apex:pageBlockSection>
    </apex:pageBlock>
    Here, account.Name specifies the current account record’s name field, whereas account.Owner.Name looks at the owner field of the account record, and then retrieves that record’s name field.

No comments:

Post a Comment