Marc A. Donis <mad7 <at> runbox.com> writes:
> I suppose that the "1 form element" mentioned is the form's submit button.
> Any hints/clues/suggestions? What am I doing wrong here?
A simple fix is to bind your listener to the Form, not to your
Submit:
<html>
<body>
<form jwcid="@Form" listener="ognl:listeners.formSubmit">
<input type="submit" value="Submit"/>
<span jwcid=" <at> Foreach" source="ognl:someList"
value="ognl:listElement" >
<input type="checkbox" jwcid=" <at> Checkbox"
selected="ognl:checkboxSelected"/>
</span>
<br/>
</form>
</body>
</html>
The reason is, during a rewind the # of form fields must remain
unchanged from the previous render. The problem here is that
you are adding an element to the list first (the submit button)
before the Foreach is rewound, so the foreach will see an extra
element and cause the mismatch. Moving the listener to the Form
will make it run after the Foreach.
There is a whole chapter in my book (dynamic forms) to explain
this issue in more depth.
--
Author of an e-Book for learning Tapestry (http://www.agileskills2.org/EWDT)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]