0

I have a code xhtml:

...
<p:accordionPanel var="mVar" value="#{someBean.someList}" >
    <p:tab>
        <f:facet name="title">
            <h:outputText value="#{mVar.id} - #{mVar.name}"/>
            ...
        </f:facet>
        <h:panelGrid>
            ...
            <c:forEach items="#{someBean.someFunctionReturningList(mVar.id)}" var="mImg">
                <h:outputText value="#{mImg}"/>
            </c:forEach>
        </h:panelGrid>
    </p:tab>
</p:accordionPanel>
...

And the java code:

public List<String> listAllImagesForCampaign(BigInteger id) {
    List<String> allImages = new ArrayList<String>();
    ...
    return allImages;
}

And the problem is, that BigInteger id contains value 0, when mVar.id is 64 for example. Is there a bug that i cant catch or sth wrong with primeface component?

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
  • 1
    Possible duplicate of [JSTL in JSF2 Facelets... makes sense?](http://stackoverflow.com/questions/3342984/jstl-in-jsf2-facelets-makes-sense) – Kukeltje Aug 25 '16 at 08:28

1 Answers1

1

Changing c:forEach to ui:repeat solved the problem.

<ui:repeat value="#{someBean.someFunctionReturningList(mVar.id)}" var="mImg">
  • 1
    Thats because c:forEach is a TagHandler and is processed before p:accordionPanel. While p:accordionPanel and ui:repeat are components. https://rogerkeays.com/jsf-c-foreach-vs-ui-repeat – tak3shi Aug 24 '16 at 12:50