Re: How to implement an auto-save behavior

2014-02-11 Thread Boris Goldowsky
Thank you Martin, that works like a charm.

Boris


On Feb 10, 2014, at 2:27 PM, Martin Grigorov mgrigo...@apache.org wrote:

 Hi,
 
 To submit a form all you need to provide to the object you pass to
 Wicket.Ajax.ajax() is the 'f' attribute:
 Wicket.Ajax.post({ u: 'url/to/AjaxFormSubmitBehavior', f: 'formId', sc:
 'optionalSubmittingComponentId'});
 
 I will update the Ajax chapter in the Reference guide soon to explain the
 JS API.
 
 Martin Grigorov
 Wicket Training and Consulting
 
 
 On Mon, Feb 10, 2014 at 5:48 PM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:
 
 Is not a function? If I look at the source code I see something like
 
 submitMultipartForm = function(context) {
 
 },
 
 
 
 
 On Mon, Feb 10, 2014 at 5:41 PM, Boris Goldowsky bgoldow...@cast.org
 wrote:
 
 Thanks, but that also results in Wicket.Ajax.Call.submitMultipartForm is
 not a function.
 
 I suspect the answer is to get the parameters set up correctly and then
 arrange for the result of getCallbackScript() to be called periodically.
 If someone else has done something like this and has a working example
 that would be really helpful.
 
 Boris
 
 
 
 On Feb 10, 2014, at 11:08 AM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:
 
 Maybe Wicket.Ajax.Call.subitMultipartForm?
 
 
 On Mon, Feb 10, 2014 at 4:56 PM, Boris Goldowsky bgoldow...@cast.org
 wrote:
 
 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: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 --
 Regards - Ernesto Reinaldo Barreiro
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 --
 Regards - Ernesto Reinaldo Barreiro
 


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



How to implement an auto-save behavior

2014-02-10 Thread Boris Goldowsky
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: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to implement an auto-save behavior

2014-02-10 Thread Ernesto Reinaldo Barreiro
Maybe Wicket.Ajax.Call.subitMultipartForm?


On Mon, Feb 10, 2014 at 4:56 PM, Boris Goldowsky bgoldow...@cast.orgwrote:

 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: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Regards - Ernesto Reinaldo Barreiro


Re: How to implement an auto-save behavior

2014-02-10 Thread Boris Goldowsky
Thanks, but that also results in Wicket.Ajax.Call.submitMultipartForm is not a 
function”.

I suspect the answer is to get the parameters set up correctly and then arrange 
for the result of getCallbackScript() to be called periodically.  If someone 
else has done something like this and has a working example that would be 
really helpful.

Boris



On Feb 10, 2014, at 11:08 AM, Ernesto Reinaldo Barreiro reier...@gmail.com 
wrote:

 Maybe Wicket.Ajax.Call.subitMultipartForm?
 
 
 On Mon, Feb 10, 2014 at 4:56 PM, Boris Goldowsky bgoldow...@cast.orgwrote:
 
 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: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 -- 
 Regards - Ernesto Reinaldo Barreiro


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



Re: How to implement an auto-save behavior

2014-02-10 Thread Ernesto Reinaldo Barreiro
Is not a function? If I look at the source code I see something like

submitMultipartForm = function(context) {

},




On Mon, Feb 10, 2014 at 5:41 PM, Boris Goldowsky bgoldow...@cast.orgwrote:

 Thanks, but that also results in Wicket.Ajax.Call.submitMultipartForm is
 not a function.

 I suspect the answer is to get the parameters set up correctly and then
 arrange for the result of getCallbackScript() to be called periodically.
  If someone else has done something like this and has a working example
 that would be really helpful.

 Boris



 On Feb 10, 2014, at 11:08 AM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

  Maybe Wicket.Ajax.Call.subitMultipartForm?
 
 
  On Mon, Feb 10, 2014 at 4:56 PM, Boris Goldowsky bgoldow...@cast.org
 wrote:
 
  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: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  --
  Regards - Ernesto Reinaldo Barreiro


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




-- 
Regards - Ernesto Reinaldo Barreiro


Re: How to implement an auto-save behavior

2014-02-10 Thread Martin Grigorov
Hi,

To submit a form all you need to provide to the object you pass to
Wicket.Ajax.ajax() is the 'f' attribute:
Wicket.Ajax.post({ u: 'url/to/AjaxFormSubmitBehavior', f: 'formId', sc:
'optionalSubmittingComponentId'});

I will update the Ajax chapter in the Reference guide soon to explain the
JS API.

Martin Grigorov
Wicket Training and Consulting


On Mon, Feb 10, 2014 at 5:48 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Is not a function? If I look at the source code I see something like

 submitMultipartForm = function(context) {

 },




 On Mon, Feb 10, 2014 at 5:41 PM, Boris Goldowsky bgoldow...@cast.org
 wrote:

  Thanks, but that also results in Wicket.Ajax.Call.submitMultipartForm is
  not a function.
 
  I suspect the answer is to get the parameters set up correctly and then
  arrange for the result of getCallbackScript() to be called periodically.
   If someone else has done something like this and has a working example
  that would be really helpful.
 
  Boris
 
 
 
  On Feb 10, 2014, at 11:08 AM, Ernesto Reinaldo Barreiro 
  reier...@gmail.com wrote:
 
   Maybe Wicket.Ajax.Call.subitMultipartForm?
  
  
   On Mon, Feb 10, 2014 at 4:56 PM, Boris Goldowsky bgoldow...@cast.org
  wrote:
  
   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: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
  
   --
   Regards - Ernesto Reinaldo Barreiro
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 


 --
 Regards - Ernesto Reinaldo Barreiro