I’m attempting to migrate an auto-saving behavior from wicket 1.5 to wicket 6.
In wicket 1.5 it worked by doing something like this every 30 seconds to loop
through auto-save-enabled forms on the page and submit them:
$("form.ajaxAutoSave").each(function() {
var form = $(this);
wicketSubmitFormById(form.attr('id')...)
}
The AJAX migration documentation -
https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax - suggests
replacing Wicket.submitFormById with Wicket.Ajax.submitForm , but this method
does not appear to exist: replacing the above code with
$("form.ajaxAutoSave").each(function() {
var form = $(this);
//unsure of expected params so just picked one from the migration
documentation
Wicket.Ajax.submitForm({"f":form.attr('id')});
}
When the function is called I can see the following error in the console:
Uncaught TypeError: Object # has no method 'submitForm'
So I went into the console and I can see that Wicket.Ajax is defined, but
Wicket.Ajax.submitForm is not.
Is the documentation incorrect here, or is there some additional step to take
to gain access to the submitForm method?
Alternatively - is there a better way to create an auto-save behavior?
AjaxFormSubmitBehavior would appear to almost meet the need, if there is a way
to tie it to a timer-generated event.
Boris
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]