Tag Archives: iterator

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.

ChangeEventPolicy in iterator

By default the iterator will refresh when the user first enters the page. But sometimes you need to control the refresh action of the iterator for some reason.

There are three optional iterator properties Refresh, RefreshCondition,and RefreshAfter which will control the refreshing of the iterator accordingly.

ChangeEventPolicy property in the iterator controls the behavior of the refresh action. It has three properties

none – by default, iterator refreshes according to the refreshcondition specified

push – asynchronous data change in the model layer will be pushed automatically.. used in BAM and Active Data Components

ppr – this will decide on when to refreshes the components bound to the iterator. If the current row of the iterator is changed and when the ppr is occurred the iterator will get refreshed to reflect the changed data

How to get reference to currentRow for af:table

to get the current row, using the TableIterator as the executable