I'm trying to work with an unusual ActiveForm bean in Struts. The bean
contains a collection of objects called ItemBean. Each ItemBean
contains (among many other things) a collection of beans called
PriceBean. In my HTML form I want to show each price for each item. So
I coded something like this (ItemList.itemList is the collection of
ItemBeans, ItemBean.prices is the collection of PriceBeans, each
PriceBean has a property named "price"):
<c:forEach items="${ItemList.itemList}" var="item" >
<tr class="listRowY">
<td title="<c:out value="${item.item_Spec}"/>">
<c:out value="${item.short_Item_Spec}"/>
</td>
<c:forEach items="${item.prices}" var="price" >
<td class="moneyCell" nowrap="nowrap" style="font-size:8pt">
<html-el:text name="price" property="price" indexed="true"/>
</td>
</c:forEach>
</tr>
</c:forEach>
This works beautifully for building and displaying the page. Of
course, all the <html-el..> items get name properties of
"price[n].price".
When I try to submit this form, I get a ClassCastException. This
apparently happens before the associated Action is called, when Struts
is trying to build the ActiveForm bean. I understand this is
non-standard and is probably confusing Struts.
I tried removing the inner loop, and putting five individual <html-el>
statements, but I get only error messages.
I've read the docs for the "nested" tags, but I still can't figure out how
to use them with nested iterations (the docs are nearly unreadable, and
there are no examples).
Is there a way to do this within Struts?
--
Tim Slattery
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]