I have <t:datatable> inside which <c:forEach> items inside <c:forEach> have list. (I checked from backend bean).
<t:dataTable id="insuranceListTable" rowIndexVar="row" width="100%"
styleClass="table" cellspacing="0" border="0"
value="#{insuranceBackingBean.allInsurancesByPatientId}"
var="insuranceBean">
<h:column>
<f:facet name="header">
<f:verbatim>Drug Formulary</f:verbatim>
</f:facet>
<h:panelGroup id="formularyInformation">
<h:panelGroup rendered="#{!empty insuranceBean.response4CheckDrugFormulary.reactionList[0].warningList}">
<c:forEach items="${insuranceBean.response4CheckDrugFormulary.reactionList[0].warningList}" var="warning">
<b><span title="${warning.warningText}"><c:out value=" [${warning.warningCode}] "></c:out></span></b>
</c:forEach>
</h:panelGroup>
<a4j:commandLink onclick="setVisibleAlternativeListGrid();" rendered="#{!empty insuranceBean.response4CheckDrugFormulary.reactionList[0].drugAlternativeList.alternativeList}">
<a href="#" id="alternative">Alternative [<h:outputText value="#{insuranceBean.response4CheckDrugFormulary.reactionList[0].drugAlternativeList.count}"></h:outputText>]</a>
</a4j:commandLink>
<a4j:commandLink onclick="setVisibleAlternativeListGrid();" rendered="#{!empty insuranceBean.response4CheckDrugFormulary.reactionList[0].coPayList}">
<a href="#" id="coPay">Co-Pay</a>
</a4j:commandLink>
</h:panelGroup>
</h:column>
</t:dataTable>
Below doesn’t reflect any thing… 🙁
<c:forEach items="${insuranceBean.response4CheckDrugFormulary.reactionList[0].warningList}" var="warning">
<b><span title="${warning.warningText}"><c:out value=" [${warning.warningCode}] "></c:out></span></b>
</c:forEach>
JSTL tags runs during view build time wherein the JSF component tree is produced based on the view source code. JSF components runs during view render time wherein HTML output is produced based on the JSF component tree. In other words, JSTL tags and JSF components doesn’t run in sync as you’d expect from the coding.
In your particular case, at the moment
<c:forEach>runs, the${insuranceBean}will always evaluate tonull, because that’s been definied asvarof JSF<t:dataTable>component which isn’t running at that moment.You need
<t:dataList>instead of<c:forEach>.See also: