>
>
>    1. I do not want to reload pages: everything needs to work smoothly as 
>    a desktop app. (of course, not all interactions with web2py, just the ones 
>    related to this one real-time component). I guess the right tool for this 
>    job would be the ajax function in web2py.ps. Is this tool able to 
>    handle complex data?
>
> The ajax() function is just a basic convenience function. It pulls values 
from input elements, posts them via Ajax using jQuery, and places the 
returned HTML in a specified target (or executes some returned Javascript). 
It relies on jQuery for the actual Ajax calls, so if you need to do 
anything more sophisticated, you can just use jQuery directly. You should 
be able to handle whatever Ajax you need.

>
>    1. the ajax events must not only be generated by the user, but also 
>    autonomously by the web browser. In pyjamas I am doing this with a Timer, 
>    which translates to some timer javascript events. Is this possible in 
>    web2py? Is there an example of a javascript timer triggering ajax requests 
>    in web2py?
>
> If you use a web2py Ajax component (which uses the web2py_component() JS 
function), in trunk there is now a timer option. Otherwise, you should be 
able to implement your own timer. Note, anything you can do with Ajax is 
technically possible with web2py -- web2py is a server-side framework and 
is happy to receive Ajax requests and return responses. Most of the effort 
will be on the client side -- for that, web2py provides some convenience 
methods, but you are free to use other third-party libraries or build your 
own JS/Ajax solution.

Anthony

-- 



Reply via email to