Monthly Archives: January 2012

Display iterated list in horizontal fashion

Recently I had a challenge of showing the list in a horizontal fashion in two columns which I had thought would be easy to implement using af:iterator and af:panelGroupLayout. But when I actually tried it, the horizontal display of the iterated list becomes a challenge.
I tried a couple of options to display close to the requirement but was not actually reaching there.
Finally I got the solution by using

panelFormLayout id="pfl1" rows="1" maxColumns="2">
forEach items="#{List}" var="row" step="2" begin="0">
<af:forEach items="#{List}" var="row" step="2" begin="1">

The step and the begin attribute is the key here along with the maxColumns and rows.