Hi, is there anyone on the list that could shed some light on the problem I'm having?
Thanks, Ryan On Fri, Jan 31, 2014 at 10:41 AM, Ryan <rnidef...@gmail.com> wrote: > Hoping I can still get some help with Tapestry 4 on this mailing list - I > know its old but unfortunately I'm stuck with it and cannot upgrade at this > time. > > I've got a form containing a table with two columns. The table is > constructed using contrib:TableView and the source paramter is a > Map<String,Object>. This map is dynamically created each time the page > renders and contains three keys: > > - id (int) > - name (string) > - checked (boolean) > > Here is the form: > > <form jwcid="addRegion@Form"> > <span jwcid="@Hidden" value="ognl:id"/> > <span jwcid="@Hidden" value="ognl:name"/> > <table class="form"> > <tr> > <th>Name</th> > <td><input jwcid="@TextField" displayName="Name" > value="ognl:newRegion.name" size="40"/></td> > </tr> > <tr> > <td></td> > <td align="right"> > <input type="submit" jwcid="add@Submit" > label="Add Region" class="button" listener="listener:doAdd" > parameters="ognl:{id,name }"/> > </td> > </tr> > </table> > <table jwcid="sitesTable@contrib:TableView" pageSize="25" > width="100%" class="header" source="ognl:availableSites" columns="Site > Name:description"> > <tr> > <td jwcid="@contrib:TableColumns" class="header"/> > </tr> > <tr jwcid="@contrib:TableRows" row="ognl:site" > class="ognl:beans.evenOdd.next"> > <td jwcid="@contrib:TableValues" align="left" > class="cute"/> > <td align="left"> > <input type="checkbox" jwcid="@Checkbox" > id="ognl:'checked_' + site.id" value="ognl:site.checked"/> > </td> > </tr> > </table> > </form> > > This form and enclosed table render properly, however the part I'm stuck > on is how to determine that 'checked_<id>' is true. I have never been clear > on exactly how the TableRow object needs to be wired, but I have included > this method in my backing class: > > public abstract Map<String,Object> getSite(); > > but neither the Map returned by this method nor the Map in > 'availableSites' has the 'checked' property set to True when I try to > determine it within my doAdd() method. > > From what I understand of Tapestry4 and the form component, the checkbox > 'value' is the property that is inspected on read and set on post, which > means it must map to a concrete, defined method or property. I can't do > that since I'm determining the items in the map dynamically. > > What do you suggest? > > Thanks, > Ryan > >