[Seaside] onClick vs callback
Lukas Renggli
renggli at gmail.com
Thu Feb 7 11:04:56 UTC 2008
> But I also need some javascript in onClick event generated by evaluator.
This is AJAX and the A is for asynchronous. This means the evaluator
will return immediately after having set off a request in a background
thread. If you change to a different page right away, the background
request is aborted/ignored.
> The problem is, that the javascript code from onClick seems to be executed
> only if I call "return: false" for the evaluator. But in this case, the
> callback of the button is not run :(
"return: false" tells the browser *not to perform* the callback.
> "return: false" with triggerForm(Element): doesn't work.. Is the answer
> evaluated before the javascript and then it doesn't make sense or is there
> any other problem..?
You can tell your evaluator not to be asynchronous using
"asynchronous: false". However consider the comment for this method:
"Determines whether XMLHttpRequest is used asynchronously or not.
Since synchronous usage is rather unsettling, and usually bad taste,
you should avoid changing this. Seriously."
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch
More information about the seaside
mailing list