[Bese-devel] UCW AJAX Question

Attila Lendvai attila.lendvai at gmail.com
Fri Jun 29 09:43:39 UTC 2007


> How to call Lisp methods directly from JavaScript and return results through AJAX callback ?
> According UCW examples I could register AJAX action for button or another widget, but I didn't found how to call AJAX method from arbitrary JavaScript function. For example, I create a table with JavaScript which do all rendering at client side, JavaScript decides when to make request to server for next portion of information.

check out the new js-to-lisp-rpc macro. it has a little deficiency,
though: dojo does not propagate the return values of the load function
properly, so the lisp return value is not returned correctly to the js
code for now.

but you can specify custom "node walkers" to process parts of the ajax
answer (xml in the standard ucw js functions), check out
ajax-render-new-tab that renders a dojo tab and sends it down to the
js. this node walking stuff may deserve some cleanup, but conceptually
it won't be much different.

you can also find examples to js-to-lisp-rpc in dojo-widgets.js, for
example in the dojo-inline-edit-box.

-- 
 attila



More information about the bese-devel mailing list