0

Visual force page code:

<apex:page standardController="Account" extensions="Contactextctroller" recordSetVar="lstacc"  setup="false" sidebar="false" showHeader="false">

<apex:pageBlock title="AccountRecords">
<apex:outputPanel layout="block" style="overflow:auto;height:150px">

<apex:pageblockTable value="{!lstacc}" var="acc">
<apex:column value="{!acc.Name}"/>

<Apex:column value="{!acc.Industry}"/>

<apex:column value="{!acc.Phone}"/>

<apex:column value="{!acc.Rating}"/>

</apex:pageblockTable>
</apex:outputPanel>
</apex:pageBlock> 

<apex:pageBlock title="Extension Example">
   <apex:pageBlock title="Contact Records">
   <apex:pageBlockTable value="{!conList}" var="con">

   <apex:column value="{!con.LastName}"/>

   <apex:column value="{!con.FirstName}"/>

   <apex:column value="{!con.Title}"/>

   <apex:column value="{!con.Phone}"/>

 </apex:pageBlockTable>
 </apex:outputPanel>
</apex:pageBlock>

</apex:pageBlock>
  
</apex:page>

visual force page extension controller class:

public class Contactextctroller {
     
    List<schema.Contact> conList{set;get;}
    public Contactextctroller(ApexPages.StandardSetController controller) {
    
    conList = [Select id,FirstName, LastName, Title, phone, birthdate from Contact];
    
    }

}enter image description here

1

You seem to have missed marking the property as public, due to that the VF page is unaware of that property. Try adding public access modifier to conList:

public List<schema.Contact> conList { set;get; }
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.