Hi guys,
I am trying to have a button that instead of doing a form submit and a whole page render, simply serializes the form and tries to re-render something. My code is this:
html tbsButton bePrimary; bePush; value: 'Save'; onClick: (html jQuery ajax serializeChildren: (html jQuery: '#myFormID'); callback: [ self halt. ] ; script: [ :s | self halt. s << (s jQuery id: ('tr1')) replaceWith:[:r | r html: 'mariano' ]] )
So I am declaring this button which is #bePush (to avoid a whole page render). Then with #serializeChildren I serialize the form (is this correct?), and finally with #script: I try to re-render again that row (in the example I simply display 'mariano'). 'tr1' is the correct id of the correct TR.
I want #script: to be called AFTER the ajax callback. But it seems that if I define a #script: then the AJAX callback is not executed :( If I don't put the #script:, it is called...
Also..when I click on that button, in the FF dev console I see "Use of attributes' specified attribute is deprecated. It always returns true.".
Any ideas what I am doing wrong? Probably many things...
Thanks in advance,
Maybe you should use #onComplete: instead of #script: in your JQAjax object.
ouuuuch
sorrryyyy by bad hahahhaha. Very funny. I will explain later. Don't loose your time.
Best,
On Thu, Jul 10, 2014 at 6:00 PM, Esteban A. Maringolo emaringolo@gmail.com wrote:
Maybe you should use #onComplete: instead of #script: in your JQAjax object. _______________________________________________ seaside mailing list seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Well...not there yet...now I am able to render the new table row with all the 'mariano'. And the row itself seems to reflect changes (the callback of the ajax is really executed). The problem now is that I don't know how to make my render script to happen AFTER the callback of the ajax. I tried #script: , #onComplete: and #onSuccess: (just in case). What I need is to make the ajax call, serialize the form, execute the ajax callback, and then do the replace of the tr (with a script).
The only one that seems to be executed later is #script: but when I do this, the callback of the ajax is not executed.
Any ideas?
Thanks,
On Thu, Jul 10, 2014 at 6:22 PM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
ouuuuch
sorrryyyy by bad hahahhaha. Very funny. I will explain later. Don't loose your time.
Best,
On Thu, Jul 10, 2014 at 6:00 PM, Esteban A. Maringolo < emaringolo@gmail.com> wrote:
Maybe you should use #onComplete: instead of #script: in your JQAjax object. _______________________________________________ seaside mailing list seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-- Mariano http://marianopeck.wordpress.com
seaside@lists.squeakfoundation.org