function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sfdc@SmithaSfdc@Smitha 

how to display the list of records in a vf page?

Hi

 

  Iam having bad coding experience Pls help me in coding.How to display list of records in a visual force page?can anybody help me?

Laxman RaoLaxman Rao

If you want to display list of records you can use

apex:pageBlockTable

apex:repeat

apex:dataTable

 

Refer this : https://ap1.salesforce.com/apexpages/apexcomponents.apexp

 

try this:

<apex:page controller="example4">
<apex:pageBlock >
<apex:pageBlockSection title="Page Block Table">
<apex:pageBlockTable value="{!accs}" var="a">
<apex:column value="{!a.Name}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock >
</apex:page>

public with sharing class example4 {

public list<Account> accs {get;set;}

public example4() {
accs = [Select Name From Account Limit 100];
}
}

Sfdc@SmithaSfdc@Smitha

Hi laxman thank you for reply.I want controller also mean controller code can u send me?

Sfdc@SmithaSfdc@Smitha

Thanku for reply laxman i want all the fields display in vf page by using for loop can we display ?if it posible can u send me the controler by using for loop.