I'm trying to enhance a portion of code in my application. I'm currently listing a set of comments with a code like this:
<c:forEach items="{myBean.items}" var="it" varStatus="st">
<p:panel id="child_#{st.index}">...</p:panel>
...
</c:forEach>
this allows me to update every single panel referring to it's ID which using <c:forEach/> I can assume is unique. But this is somehow a rigid way of doing it because it obligues me to load the whole set of items at once. I would like to implement something like <p:dataScroller> in order to make it lazy and been able to load on demand, but if I use it something like this:
<p:dataScroller value="{myBean.items}" rowIndexVar="st" var="it">
<p:panel id="child_#{st}">...</p:panel>
...
</p:dataScroller>
I get a "Cannot find component for expression child_ ..." error, which I understand shows up because the value of 'st' is not available yet in the JSF phase in which the panel component is rendered. Is there any possible way to achieve this? Either still using c:forEach o adapting my code with <p:dataScroller/> ?
Thanks.