You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Edgar Merino <do...@gmail.com> on 2008/10/07 23:58:54 UTC

Submit a form automatically after N seconds

Hello, I've been trying to add this functionality to a component, after 
(say) 120 seconds I want to submit the form automatically (via ajax) in 
order to create a backup of the information hold at that time by the 
component. I've been looking at ajaxformsubmitbehavior but I don't see 
how to make this work with what I need. I think an 
abstractajaxtimerbehavior is what I need here but I need to know how to 
submit the form in the onTimer method.

Thanks in advance.
Edgar Merino

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Submit a form automatically after N seconds

Posted by Jeremy Thomerson <je...@wickettraining.com>.
I have not tried this, and there are probably better ways, but you might be
able to:

- create a subclass of AbstractAjaxTimerBehavior
- override getCallbackScript and return the code that is generated by
AjaxFormSubmitBehavior#getEventHandler

This would involve copy-and-paste of some code out of
AjaxFormSubmitBehavior, but I'm not sure that's a big deal.

-- 
Jeremy Thomerson
http://www.wickettraining.com

On Tue, Oct 7, 2008 at 4:58 PM, Edgar Merino <do...@gmail.com> wrote:

> Hello, I've been trying to add this functionality to a component, after
> (say) 120 seconds I want to submit the form automatically (via ajax) in
> order to create a backup of the information hold at that time by the
> component. I've been looking at ajaxformsubmitbehavior but I don't see how
> to make this work with what I need. I think an abstractajaxtimerbehavior is
> what I need here but I need to know how to submit the form in the onTimer
> method.
>
> Thanks in advance.
> Edgar Merino
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>