On Fri, 04 May 2012 10:16:33 -0300, wout86 <wouter.amerij...@gmail.com>
wrote:
Anyway, after inspecting the stack trace, I found out that Tapestry is
re-evaluating the /validate/ parameter of a TextField upon form
submission.
More specifically, when the form is submitted, the TextField is asked to
validate itself and to this end it attempts to re-evaluate its validate
parameter.
Clearly, this is undesired behavior and it would be nice to have this
disabled in later versions of Tapestry (assuming that in most use-cases,
fields on a page require the exact same validators at validate-time as
those that were passed to them at render-time).
I disagree. Tapestry would need to persist the validators somehow.
I did manage to find a solution though: rather than using a render
variable, mycomponent takes an extra parameter, namely a persisted
property. The
property is set while mycomponent is rendered, and because it's
persisted, it remains bound when the form is submitted.
You could also make your component render some hidden field containing the
data you need to evaluate the validators needed.
--
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