By the way. This happens regardless, if I have t:context on the form or not.
<t:form t:id="cartForm" t:context="cartDisplayItem.sku"> Adam On Mon, Feb 28, 2011 at 7:33 AM, Adam Zimowski <zimowsk...@gmail.com> wrote: > Hi again. I hate to interrupt the mutliple database discussion, but I > would like to ask a question regarding the original topic on this > thread..... > > So, per Thiago's suggestion I tried loop with multiple form > components, and I have an issue in that if I submit one row (one form) > with invalid input (non-numeric quantity), all quantity fields get the > invalid value and show up in error (see attached). I do not display > error messages at this point yet, just trying to get forms to work. I > haven't done anything out of the ordinary, so I probably missed > something.. > > <table border="1"> > <tr> > <th>Item #</th> > <th>Product Description</th> > <th>Usually Ships</th> > <th>Quantity</th> > <th>Price ea.</th> > <th>Extended Price</th> > <th/> > </tr> > <t:loop source="shoppingCartForDisplay" value="cartDisplayItem" index="index"> > <t:form t:id="cartForm"> > <tr> > <td>${cartDisplayItem.sku}</td> > <td>${cartDisplayItem.description}</td> > <td> > <t:if test="cartDisplayItem.leadTime"> > ${cartDisplayItem.leadTime} day(s) > <p:else>Today</p:else> > </t:if> > </td> > <td><t:textfield t:id="quantity" size="1" validate="required" > value="cartDisplayItem.quantity"/></td> > <td>${cartDisplayItem.price}</td> > <td>${cartDisplayItem.total}</td> > <td> > <t:submit t:id="update" value="message:update-value" t:context="index"/> > <t:submit t:id="remove" value="message:remove-value" t:context="index"/> > </td> > </tr> > </t:form> > </t:loop> > </table> > > Adam > > On Sun, Feb 27, 2011 at 8:20 PM, Thiago H. de Paula Figueiredo > <thiag...@gmail.com> wrote: >> On Sun, 27 Feb 2011 21:59:38 -0300, Tom van Dijk <t...@tvandijk.nl> wrote: >> >>> Op 28-2-2011 1:08, Thiago H. de Paula Figueiredo schreef: >>>> >>>> On Sun, 27 Feb 2011 19:42:35 -0300, Tom van Dijk <t...@tvandijk.nl> wrote: >>>> >>>>> the list of "A" items. I very quickly ran into problems with the >>>>> combination of nested zones, loops, forms and actions, partially because >>>>> the >>>>> client IDs of the zones and forms tended to change and after I edited >>>>> something, the page was broken. >>>> >>>> Provide explicit ids for all components and this problem should go away. >>>> >>> Um, it became ZoneId_1 and ZoneId_2 and so forth. Or do I miss something >>> here? >> >> I forgot to mention: if the Zone (or any other component) is located inside >> a Loop or Grid, you cannot just give a static id. Something like this: >> >> <li t:type="Loop" t:source="objects" t:value="object"> >> <div t:type="Zone" id="zone-${object.id}">...</div> >> </li> >> >> -- >> Thiago H. de Paula Figueiredo >> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and >> instructor >> Owner, Ars Machina Tecnologia da Informação Ltda. >> http://www.arsmachina.com.br >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org