Well, there are some options here... Try removing public abstract boolean getSomeValue(); and use
public boolean getSomeValue() { // return the correct value using getCurrentListItem() } public void setSomeValue(boolean value) { // store the value using getCurrentListItem() } On Jan 7, 2008 2:38 PM, Petri Wessman <[EMAIL PROTECTED]> wrote: > Andreas Andreou wrote: > > Hi, what's the problem with just binding the value parameter of > > http://tapestry.apache.org/tapestry4.1/components/form/checkbox.html ? > > Well, the question becomes "what do I bind it to?". Up to now, I've been > using a static number of checkboxes per page, and each one has been > given an OGNL property as value, e.g.: > > <input type="checkbox" jwcid="@Checkbox" value="ognl:someValue"/> > > with the code having: > > public abstract boolean getSomeValue(); > > In this case, I have a variable number of checkboxes per page, I'd need > to bind them to array elements (I guess) or some such. How do I do that > in OGNL? > > As a simplified concrete example, I'd have something like this on the page: > > <table> > <div jwcid="@For" source="ognl:itemList" value="ognl:currentListItem"> > <tr> > <td><span jwcid="@Insert" value="ognl:currentListItem.name"/></td> > <td><input type="checkbox" jwcid="@Checkbox" value="???"/></td> > </tr> > </div> > </table> > > What goes in "???" ? > > Sorry if I'm missing something obvious here, but so far RTFM hasn't > clued me in sufficiently :/. > > //Petri > > > > On Jan 7, 2008 1:31 PM, Petri Wessman <[EMAIL PROTECTED]> wrote: > >> Hello all, using Tapestry 4.0.2 here (had some Javascript issues when > >> trying to upgrade to 4.1.x, so putting off upgrading till I figure those > >> out). Anyway, I'm now trying to implement a new functionality to our app > >> and am a bit puzzled as to the best way to do it. > >> > >> What I want to do is have a list of items (0-N items), and a checkbox > >> next to each one (i.e. one checkbox per line item). Below this list I'll > >> have controls to "delete all checked items" (or in general, "do X to > >> checked items"). Pretty basic UI functionality... except that I'm > >> stumped as how to do it with Tapestry. > >> > >> I'm generating the list with a normal @For loop, and that works fine. > >> The checkboxes I need some help on, though... how do I bind a list of > >> checkboxes to values, so that I can figure out which one is related to > >> which line item on form submit? > >> > >> All help appreciated. If it requires upgrading to 4.1.x, then that's > >> doable too, with some extra work. > >> > >> //Petri > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]