You need to sign in to do that
Don't have an account?

Ability to look ahead 1 row from within <apex:repeat> loop..
Hi, I need to perform some page break logic, and would like to be able to look at the NEXT row from within a repeat loop to determine if the value is about to change.
For the display logic I can't check AFTER the next row is read, I need to check the NEXT row's value while processing the CURRENT row.
So is there some way to access the relatedHoldings2[row + 1] while I am processing the current row in the loop?
Thanks!
<apex:repeat var="fa" value="{!relatedHoldings2}">
Compare relatedHoldings2.val from row #2 with relatedHoldings2.val from current row
</apex>
var="fa" value="{!relatedHoldings2}">
I actually found a way...
I created an apex:variable, and used it as a rowct, then I used it as an index to access the rowct + 1 row:
For example:
Whie in my apex:Repeat
myrowt = myrowct + 1 (apex:variable)
finacct[myrowct + 1].myfield (the NEXT rows value)
Thanks.