Here's my problem: During a display of the page, I use:
<logic:iterate name="materialForm" property="substances" id="substances"> <tr> <td class="table2"><html:text name="substances" property="casNumber" styleClass="input1"/></td> <td class="table2"><html:text name="substances" property="substanceName" styleClass="input1"/></td> </tr> </logic:iterate> But I also want to update the values. The html then becomes: <tr> <td class="table2"><input type="text" name="casNumber" value="14807-96-6" class="input1"></td> <td class="table2"><input type="text" name="substanceName" value="Talc" class="input1"></td> </tr> <tr> <td class="table2"><input type="text" name="casNumber" value="25068-12-6" class="input1"></td> <td class="table2"><input type="text" name="substanceName" value="Ethylene/styrene copolymer" class="input1"></td> </tr> <tr> <td class="table2"><input type="text" name="casNumber" value="63148-62-9" class="input1"></td> <td class="table2"><input type="text" name="substanceName" value="Polydimethyl siloxane" class="input1"></td> </tr> <tr> <td class="table2"><input type="text" name="casNumber" value="9003-53-6" class="input1"></td> <td class="table2"><input type="text" name="substanceName" value="Polystyrene" class="input1"></td> </tr> So now, the bean doesn't find any getSubstanaces(ArrayList), it only sees a bunch of casNumbers and substanceNames. If I say, getCasNumber() in the bean, it only gets the first one. How do people deal with this in struts? ken -----Original Message----- From: keithBacon [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 07, 2002 3:06 AM To: Struts Users Mailing List Subject: Re: getting a list in Action class tricky! does myForm.getSubstances(); return a list? is it the correct size? I would have thought putting enough debug messages would highlight the problem. I'd guess it's not even executing your debug code because you'd get a null pointer exception from list.iterator() if the list was missing & CalssCastExp if you got the wrong list. Intriguing! (Most likely something really obvious... bit I can't see it.) Keith. --- "Domen, Ken" <[EMAIL PROTECTED]> wrote: > If my jsp has the following: > > <logic:iterate name="xxxForm" property="substances" id="substanceBean"> > <tr><td <html:text name="substanceBean" property="casNumber" /></td> > <td <html:text name="substanceBean" property="substanceName"</td> > </tr> > </logic:iterate> > > Why won't my receiving Action class get these elements with: > > ArrayList list = myForm.getSubstances(); > Iterator i = list.iterator(); > while (i.hasNext()) { > Substance s = (Substance)i.next(); > System.out.println("s.getCasNumber(): " + s.getCasNumber()); > } ===== ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Search the archive:- http://www.mail-archive.com/struts-user%40jakarta.apache.org/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Bacon - Looking for struts work - South-East UK. phone UK 07960 011275 __________________________________________________ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>