Skip to main content
added 314 characters in body
Source Link
Oles Malkov
  • 2.2k
  • 3
  • 16
  • 29

Jeff has a nice post on that in his blog here. Also if you use wrapper class you can just create another variable there and display it as a first column.

Here is an example:

<apex:variable value="{!1}" var="rowNum"/>

<apex:dataList value="{!myCollection}" var="item">  
  <apex:outputText value="{!FLOOR(rowNum)}"/> - <apex:outputField value="{!item.Name}"/>
  <apex:variable var="rowNum" value="{!rowNum + 1}"/>
</apex:dataList> 

Jeff has a nice post on that in his blog here. Also if you use wrapper class you can just create another variable there and display it as a first column.

Jeff has a nice post on that in his blog here. Also if you use wrapper class you can just create another variable there and display it as a first column.

Here is an example:

<apex:variable value="{!1}" var="rowNum"/>

<apex:dataList value="{!myCollection}" var="item">  
  <apex:outputText value="{!FLOOR(rowNum)}"/> - <apex:outputField value="{!item.Name}"/>
  <apex:variable var="rowNum" value="{!rowNum + 1}"/>
</apex:dataList> 
Source Link
Oles Malkov
  • 2.2k
  • 3
  • 16
  • 29

Jeff has a nice post on that in his blog here. Also if you use wrapper class you can just create another variable there and display it as a first column.