Play Games

Search This Blog

Thursday, April 20, 2017

Increment Apex:variable in Visualforce Page

Solution:
Intitialize apex:variable Index like this <apex:variable var="Index" value="{!0}"/>.
To Increment Index variable by 1 use the following code
<apex:variable var="Index" value="{!Index+1}"/>
Example:
Visualforce Page:
<apex:page>
<body>
<apex:variable var="Index" value="{!0}"/>
Apex Variable Index initial Value:{!Index} <br/>
<apex:variable var="Index" value="{!Index+1}"/>
Apex Variable Index value after Incrementing:{!Index}
</body>
</apex:page>
Output:


No comments:

Post a Comment