On Tue, 02 Feb 2010 13:47:36 -0200, kamiseq <kami...@gmail.com> wrote:
hi,
Hi!
void onValidateForm() {
try {
Logger.getLogger(this.getClass()).debug("**onValidateForm");
this.version = versionService.updateObjectCfg(objectDetail);
} catch (Exception e) {
// Display the cause. In a real system we would try harder to
get a user-friendly message.
form.recordError(e.getMessage());
}
}
Form submissions through AJAX only work if your onValidateForm() return
the zone's body when some validation error is found. Use this code as
example:
if (form.getHasErrors() && request.isXHR()) {
return zonaFormulario.getBody();
}
else {
return null;
}
You'll need to @Inject the Request.
If my actionLink didnt update the zone to enable the form, then
everything
would be all right and data is correctly send.
Try @Persist'ing your object. Don't forget that each request, AJAX or not,
is different, and information is only kept between requests if you persist
them some way.
--
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