<h:form>
<ui:repeat value="#{sampleManagedBean.food}" var="food">
<h:commandLink value="Name" action="#{sampleManagedBean.outcome}">
<f:param name="name" value="ssd" />
<f:param name="v" value="#{food.boy}" />
</h:commandLink>
<h2>#{food.boy}</h2>
</ui:repeat>
</h:form>
I can't get the the second <f:param> value which is set based on <ui:repeat var>. I can get only the first one which is hardcoded.
The
ui:repeatis an UI component whilef:paramis a taghandler (like JSTL). Taghandlers run during view build time before UI components which run during view render time (see here).In our case it means that in the view build phase
f:paramknows nothing about#{food.boy}.c:forEachwill be fine, but if we call some kind of ajax action to change the size of#{sampleManagedBean.food}and rerender the form, we'll not see any changes on page. Because partial rerendering (ajax) affects only UI component tree.c:forEachis somewhere between hardcoding andui:repeat, we'll have to reload the page to see changes.