Iterating 3 Lists in dataTable
Hi,
I got the following problem
I have a List of containerTypes, shippingroutes and costs.
A Containertyp is an Object with a Longvalue and a shortvalue.
A Shippingroute is only one String value.
A cost has an amount and a currency.
A cost exists for many Containertypes and many shippingroutes. I got three tables in Database, and the result looks like this
ArrayList:
{shippingroute, cost, containertype)
[0] = {ANNO, 22 USD, 20' Flat}
[1] = {ASPC, 33 USD, 40' Box}
[2] = {ANNO, 44 USD, 40'Box}
[3] = {ASPC, 55 USD, 20' Flat}
The List I want to show at Screen should have as many rows, as shippingrouts are given in the ArrayList of result, and that many columns as containertypse are given in result, so screen should give a following table
shippingroute20'Flat 40'Box
ANNO22 USD44 USD
ASPC55 USD33 USD
<t:dataTable id="dataTable_thcList" var="shippingRouteList"
value="#{searchCost..shippingRouteList}" styleClass="subList"
rows="20" rules="all" columnClasses="c1sub" headerClass="headerSub">
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.port}" />
</f:facet>
<h:outputText value="#{searchCost.portName}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.tradeRange}" />
</f:facet>
<h:outputText value="#{shippingRouteList.name}" />
</h:column>
<t:columns var="containerTypList" value="#{searchCost.containerTypList}">
<f:facet name="header">
<h:outputText
value="#{containerTypList.shortDescription}' #{containerTypList.longDescription}" />
</f:facet>
<c:forEach var="cost" items="${searchCost.CostList}">
<h:outputText value="#{(cost.containerTypList.shortDescription == containerTypList.shortDescription) && (cost.containerTypList.longDescription == containerTypList.longDescription) && (cost.shippingRoute.name == shippingRouteList.name) ? cost.amount : '-'}"/></c:forEach>
</t:columns>
</t:dataTable>
Any Idea how to itarate over 3 Lists, because with this construction I got these Exception
javax.servlet.ServletException: /jsp/thcList.jsp(76,6) According to TLD or attribute directive in tag file, attribute items does not accept any expressions
and I've found in differ forums that JSF an JSTL do not match in this way.
Help.
Stina

