+ Start a Discussion
Umesha BP 9Umesha BP 9 

how to use two labels in visualforce page in different palce?

Friends I am stuck in visualforce page with custo labels?
Label 1 "this is first label"
Label 2 "this is second label"
I want to use First Label in sirst line of page
after 10 output text 
I want to display second label 
How to do?
PawanKumarPawanKumar
Hi Umesh,

can you please try below approach.

<apex:page controller="sample" sidebar="false" >
<apex:form >
    <apex:pageblock >
        <apex:pageblockSection id="m" title="Member Details" >
            <apex:pageBlockTable value="{!mem}" var="member">
                <apex:column value="{!member.Name}"/>
            </apex:pageBlockTable>
        </apex:pageblockSection>
        
        <apex:pageblockSection id="a" title="Account Details" >
            <apex:pageBlockTable value="{!acc}" var="account">
                <apex:column value="{!account.Name}"/>
            </apex:pageBlockTable>        
        </apex:pageblockSection>      
        <apex:pageBlockButtons location="bottom" >
            <apex:commandButton value="Fetch" reRender="m,a" action="{!fetch}"/>
        </apex:pageBlockButtons>  
    </apex:pageblock>
</apex:form>
</apex:page> 

Apex Controller:

public class sample
{
    public List<Member__c> mem {get;set;}
    public List<Account> acc {get;set;}    
    
    public void fetch()
    {
        mem = [SELECT Name FROM Member__c];
        acc = [SELECT Name FROM Account];        
    }       
}

Regards,
Pawan Kumar
Umesha BP 9Umesha BP 9
@PawanKumar where is custom Labels? I want to display custom Labels in a page.
PawanKumarPawanKumar
May be I got wrong. $label.customlabelname not working for you in gf.
SFDC_DeveloperSFDC_Developer
You can refer to this (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_label.htm) document for more information about how to use label in visual force.
Umesha BP 9Umesha BP 9
Thank You all I got Solution.