T
TheVooDooChild
I have an object called "Branch" that contains a String branchName,
ArrayList barcodeList, and an ArrayList itemNumberList. I have a form
that is initialized with an array of Branches, and the ArrayLists
within them are initialized with empty strings (""). This allows me to
use the <logic:iterate> tag to create 1 row per branch and the correct
number of empty text fields needed for barcodes and itemNumbers within
that branch. All works fine until the JSP is submitted. When I fill
out the text fields and submit, I end up with only 1 Branch object in
the form, which was the 1st row on the jsp. So I get Branch[1],
barcode[1], and itemNumber[1].
Any ideas why I'm losing the rest?
I am using the struts <logic:iterate> tag in the following way:
<logic:iterate id="branch" name="FrmCustomerHolding"
property="branches" type="com.company.bdm.common.Branch" >
<tr>
<td align="left" valign="top">
<b><bean:write name="branch" property="branchName" /></b>
</td>
<td align="left">
<logic:iterate id="barcode" name="branch" property="barcodeList"
indexId="idx" type="java.lang.String" >
<logic:notEqual name="idx" value="0" >
<br>
</logic:notEqual>
Barcode <%= idx.intValue() + 1 %>: <html:text
property="barcode" />
</logic:iterate>
</td>
<td align="left">
<logic:iterate id="itemNumber" name="branch"
property="itemNumberList" indexId="idx" type="java.lang.String" >
<logic:notEqual name="idx" value="0" >
<br>
</logic:notEqual>
Item # <%= idx.intValue() + 1 %>: <html:text
property="itemNumber" />
</logic:iterate>
</td>
</tr>
</logic:iterate>
ArrayList barcodeList, and an ArrayList itemNumberList. I have a form
that is initialized with an array of Branches, and the ArrayLists
within them are initialized with empty strings (""). This allows me to
use the <logic:iterate> tag to create 1 row per branch and the correct
number of empty text fields needed for barcodes and itemNumbers within
that branch. All works fine until the JSP is submitted. When I fill
out the text fields and submit, I end up with only 1 Branch object in
the form, which was the 1st row on the jsp. So I get Branch[1],
barcode[1], and itemNumber[1].
Any ideas why I'm losing the rest?
I am using the struts <logic:iterate> tag in the following way:
<logic:iterate id="branch" name="FrmCustomerHolding"
property="branches" type="com.company.bdm.common.Branch" >
<tr>
<td align="left" valign="top">
<b><bean:write name="branch" property="branchName" /></b>
</td>
<td align="left">
<logic:iterate id="barcode" name="branch" property="barcodeList"
indexId="idx" type="java.lang.String" >
<logic:notEqual name="idx" value="0" >
<br>
</logic:notEqual>
Barcode <%= idx.intValue() + 1 %>: <html:text
property="barcode" />
</logic:iterate>
</td>
<td align="left">
<logic:iterate id="itemNumber" name="branch"
property="itemNumberList" indexId="idx" type="java.lang.String" >
<logic:notEqual name="idx" value="0" >
<br>
</logic:notEqual>
Item # <%= idx.intValue() + 1 %>: <html:text
property="itemNumber" />
</logic:iterate>
</td>
</tr>
</logic:iterate>