+ Start a Discussion

How to display data dynamically in visualforce page.



How to display fieldnames and data dynamically in visualforce page. please share the solution.







here is the simple example for display account record dynamically to visualforce page.


Visualforce Page:


<apex:page controller="customController" >
	<apex:form >
		<apex:pageBlock title="Account Details">
			<apex:pageBlockSection title="Accounts" columns="2" >			
			<apex:repeat value="{!lstAccount}" var="acc" >
				<apex:outputField value="{!acc.Name}" />

 Apex Class:


public class customController {
	public List<Account> lstAccount {get; set;}
	public customController() {
		lstAccount = [select id,name from Account];		



Important :

Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.



Hitesh Patel


Thanks for your reply, But I want to Pulling of dynamic data by the UI and displaying in visualforce page.

Bhawani SharmaBhawani Sharma
How do you want to pull it from UI?
Nazrul AminNazrul Amin
I am also interested in this question please.  I want to run a query on records and display that information in a visualforce page.  I dont want the data to come from existing fields in records, but it to be generated by code and displayed in the UI, the data does not need to be stored either.  Thanks