Sometimes it’s useful to know what the invariant value is for your loop within a facelets loop. I use ui:repeat a lot, but have seen some problems with it in the past. If you want to get the loop index for your ui:repeat, you may be disappointed. Basically, it requires that you use a different looping mechanism. A nice alternative is the a4j:repeat, which offers the same functionality, plus more awesomeness…
Enough talk, let’s fight:
1 2 3 4
If you loop four times, you should get 1,2,3,4,.
Another point of interest on these loops:
If you have jsf components within this a4j:repeat and need to know their exact id, the id on the loop will help this id be more predictable and readable. For instance, in this situation:
1 2 3 4 5