On Sun, 31 Jan 2010 16:09:11 -0200, lebenski <be...@gamesys.co.uk> wrote:
Hi,
Hi!
This is my code:
<t:loop source="draft.draftPicks" value="draftPick" volatile="true">
<t:form t:id="pickCommentForm">
...
<t:submit value="message:submit-label" />
</t:form>
</t:loop>
I'm obsering that submitting this form does not fire
onSuccessFromPickCommentForm or even just onSuccess, onValidateForm
etc. Is this because i've created multiple forms with the same id? If
so, is there a way to support form creation inside a loop like this?
Each Form component has a different id. Just use onSuccess() and use
draftPick as the context to your form. Something like this:
<t:loop source="draft.draftPicks" value="draftPick" volatile="true">
<t:form t:id="pickCommentForm" t:context="draftPick.id">
...
<t:submit value="message:submit-label" />
</t:form>
</t:loop>
Object onSuccess(Integer id) {
DraftPick draftPick = load(id);
createPickComment(draftPick, getNewComment());
}
By the way, you don't need to use the Submit component unless you have
more than one submit button in the same form.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, software architect and developer, 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