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

how can i display records using apex:repeat for custom objects

HIII.

 

i have an custom object based on the soql i have to display the results

 

how to write a repeat controller to show results on the vf page

 

plz help me

 

 

 

Pradeep_NavatarPradeep_Navatar

<apex:repeat> is used to iterate the list in VF page, value attribute of this tag should have list as value.

 

Find below  a sample code :

 

<!-- Page: -->

 

<apex:page controller="repeatCon" id="thePage">

 

    <apex:repeat value="{!strings}" var="string" id="theRepeat">

 

        <apex:outputText value="{!string}"/><br/>

 

    </apex:repeat>

 

</apex:page>

 

 

 

/*** Controller: ***/

 

public class repeatCon {

 

 

 

    public String[] getStrings() {

 

        return new String[]{'ONE','TWO','THREE'};

 

    }

 

}

 

Hope this helps.