Call controller automatically

69 views
Skip to first unread message

FERNANDO VILLARROEL

unread,
Dec 22, 2012, 2:23:14 PM12/22/12
to web...@googlegroups.com
Dear.

I have a controller that basically runs a SQL shown in their respective views.

Need is that while the user STAY in this view, the controller automatically running every 5 seconds, and so the result of the SQL refresh the view.

I could use a Refresh button, but I want it to be automatic.

How i can do?

Fernando

Anthony

unread,
Dec 22, 2012, 3:59:18 PM12/22/12
to web...@googlegroups.com
Perhaps you could use an ajax component (see http://web2py.com/books/default/chapter/29/12#Components):

{{=LOAD(..., timeout=5000, times='infinity', ajax=True)}}

That will load the component via Ajax and refresh its content every 5 seconds indefinitely.

Anthony
Reply all
Reply to author
Forward
0 new messages