function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Hi,
I am new to programming can any one help me please.i want to retrive data from database and display in VF pageblock table.
this is code to get account data from database(back end) to vf page
controller :
public class classname
{
list<account> alist=new list<account>();
public classname()
for(account a:[select name from account])
alist.add(a);
}
public list<account> getalist()
return alist;
page:
<apex:page controller="classname">
<apex:pageblock>
<apex:pageblocktable value="{!alist}" var="a">
<apex:column headervalue="name">
<apex:outputfield value="{!a.name}"/>
</apex:column>
</apex:pageblocktable>
</apex:pageblock>
</apex:page>
the code same for all custom and standard objects using controller
Are you using controller/extension?
Here is the sample code:
<apex:pageBlockTable value="{!UrObj}" var="obj" columns="2" > <apex:column headerValue="ColumnHeading1" value="{!obj.Field1}" /> <apex:column headerValue="ColumnHeading2" value="{!obj.Field2}" /> ... .. . </apex:pageBlockTable>
Thanks for your help,i will try it and keep you update.I am using custom controller.my task is use to display yearly salary according to job title in VF PAGE BLOCK table.
this is code to get account data from database(back end) to vf page
controller :
public class classname
{
list<account> alist=new list<account>();
public classname()
{
for(account a:[select name from account])
{
alist.add(a);
}
}
public list<account> getalist()
{
return alist;
}
}
page:
<apex:page controller="classname">
<apex:pageblock>
<apex:pageblocktable value="{!alist}" var="a">
<apex:column headervalue="name">
<apex:outputfield value="{!a.name}"/>
</apex:column>
</apex:pageblocktable>
</apex:pageblock>
</apex:page>
the code same for all custom and standard objects using controller
All Answers
Are you using controller/extension?
Here is the sample code:
this is code to get account data from database(back end) to vf page
controller :
public class classname
{
list<account> alist=new list<account>();
public classname()
{
for(account a:[select name from account])
{
alist.add(a);
}
}
public list<account> getalist()
{
return alist;
}
}
page:
<apex:page controller="classname">
<apex:pageblock>
<apex:pageblocktable value="{!alist}" var="a">
<apex:column headervalue="name">
<apex:outputfield value="{!a.name}"/>
</apex:column>
</apex:pageblocktable>
</apex:pageblock>
</apex:page>
the code same for all custom and standard objects using controller
Thanks for your help,i will try it and keep you update.I am using custom controller.my task is use to display yearly salary according to job title in VF PAGE BLOCK table.