4

I cannot update the list in a <c:forEach> by a backing bean. I am working with PrimeFaces 5.0 and JSF 2.0.

This is my simplified JSF code:

<c:forEach var="i" items="#{dataset.columnsList}"  varStatus="status">
    <h:outputText value="#{dataset.columnsList.size()}"/>
    <c:if test="${status.last}">
        <h:outputText escape="false" value="#{status.count}" />
    </c:if>

</c:forEach>

The code works well the first time. BUT When dataset.columnList change the field dataset.columnList.size() changes accordingly and is correct. Instead the status.count REMAINS TO THE OLD VALUE.

This fact seems be confined to <c:forEach> only.

Is there someone who can help me please?

Many thanks.

Ago
  • 41
  • 5
  • 1
    Drop `` in favour of `rendered="#{status.last}"` and make use of `` instead. – Tiny Jul 14 '15 at 11:12
  • Your question is hard to digest without a proper [MCVE](http://stackoverflow.com/tags/jsf/info). In any case, which JSF impl/version are you using? Tried the latest? A seemingly related major bug was fixed in Mojarra 2.1.18 several years ago. A PrimeFaces version that old also suggests a JSF impl version that old. – BalusC Jul 14 '15 at 11:27
  • Sorry @BalusC primefaces 5.0 not 4.0 as previously indicated. I corrected the question. Anyway i solved by a workaround `` there is no way to change the value of field "end" dinamically by a backing bean. – Ago Jul 15 '15 at 09:22

0 Answers0