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 want to display seriol numbers for the data table as 1,2,3,4,5,6,7,8,9 for the table so how to write a program
Hi,
You can acheive this by using a <apex:variable> component in your vf page.
Try the following method,
<apex:page> <apex:variable value="{!1}" var="index"> <apex:pageblocktable value="{!ListOfItems}" var="item"> <apex:column> <apex:outputlabel value="{!index}"> </apex:outputlabel>
</apex:column> <apex:column> <apex:outputlabel value="{!item.Name}"> <apex:variable value="{!index+1}" var="index"> </apex:variable>
</apex:outputlabel>
</apex:column> </apex:pageblocktable> </apex:variable>
</apex:page>
Hope so this helps you...!Please mark this answer a Solution and please give kudos by clicking on the star icon, if you found this answer as helpful.
You already having a list of records to display in the table know?. So, you don't need to write a controller for that <apex:variable/>.
Just you can include the variable component in the vf pageblocktable. Example am using List of accounts in my organisation. See the below example.
<apex:page controller = "AccountController"> <apex:variable value="{!1}" var="index"> <apex:pageblocktable value="{!ListOfAccounts}" var="item"> <apex:column> <apex:outputlabel value="{!index}"> </apex:outputlabel>
Controller:
public class AccountController{public List<Account> ListOfAccounts{get;set;} public VariableController(){ ListOfAccounts = [select id,name from Account]; }}
Hi,
You can acheive this by using a <apex:variable> component in your vf page.
Try the following method,
<apex:page>
<apex:variable value="{!1}" var="index">
<apex:pageblocktable value="{!ListOfItems}" var="item">
<apex:column>
<apex:outputlabel value="{!index}">
</apex:outputlabel>
</apex:column>
<apex:column>
<apex:outputlabel value="{!item.Name}">
<apex:variable value="{!index+1}" var="index">
</apex:variable>
</apex:outputlabel>
</apex:column>
</apex:pageblocktable>
</apex:variable>
</apex:page>
Hope so this helps you...!
Please mark this answer a Solution and please give kudos by clicking on the star icon, if you found this answer as helpful.
i am acessing pagetable in vfpage for that i need to write
Hi,
You already having a list of records to display in the table know?. So, you don't need to write a controller for that <apex:variable/>.
Just you can include the variable component in the vf pageblocktable. Example am using List of accounts in my organisation. See the below example.
<apex:page controller = "AccountController">
<apex:variable value="{!1}" var="index">
<apex:pageblocktable value="{!ListOfAccounts}" var="item">
<apex:column>
<apex:outputlabel value="{!index}">
</apex:outputlabel>
</apex:column>
<apex:column>
<apex:outputlabel value="{!item.Name}">
<apex:variable value="{!index+1}" var="index">
</apex:variable>
</apex:outputlabel>
</apex:column>
</apex:pageblocktable>
</apex:variable>
</apex:page>
Controller:
public class AccountController{
public List<Account> ListOfAccounts{get;set;}
public VariableController(){
ListOfAccounts = [select id,name from Account];
}
}
Hope so this helps you...!
Please mark this answer a Solution and please give kudos by clicking on the star icon, if you found this answer as helpful.