You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dmitry Gusev <dm...@gmail.com> on 2013/11/01 08:27:03 UTC
Re: Ajax and Validation
I know this thread is too old, but I still have this same issue in T5.3.7.
Since @PageDetached is no longer works, here is how I managed to fix this
for my form:
@Inject private Heartbeat heartbeat;
public void onSubmit()
{
if (request.isXHR())
{
// ...
ajaxResponseRenderer.addCallback(new JavaScriptCallback()
{
@Override
public void run(JavaScriptSupport javascriptSupport)
{
// ...
heartbeat.defer(new Runnable()
{
@Override
public void run()
{
form.clearErrors();
}
});
}
});
}
}
On Mon, Jun 13, 2011 at 10:07 PM, Kartweel <rh...@exemail.com.au> wrote:
> It still gave me issues when submitting a form with an error then
> submitting
> it valid, then it would bring up the old values and clobber the real values
> (after saving I default back to different data in the form).
>
> So I ammended it to
>
>
> @PageDetached
> void clearValidationTracker() {
> if (request.isXHR()) {
> if (workItemsForm.getDefaultTracker() != null)
> workItemsForm.getDefaultTracker().clear();
> workItemsForm.setDefaultTracker(null);
> }
> }
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Ajax-and-Validation-tp2431706p4485240.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Dmitry Gusev
AnjLab Team
http://anjlab.com