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.

6 thoughts on “Display iterated list in horizontal fashion

  1. Frederico Barracha

    Hi, how are you?

    I’ve tried to understand your code but i have a question on how to put the for each items.
    With this table (my example code):

    Where should i put my for each code? I can’t understand how that part of the code works.

    Thanks and regards,


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s