button to start function which dynamicly chynges page

37 views
Skip to first unread message

BlueShadow

unread,
Apr 6, 2015, 6:16:35 AM4/6/15
to web...@googlegroups.com
Hi,
I have a function in my web2py app which takes quite a while. I like to have a button on a page which starts the funktion but does not reload the page for 10 minutes. The function should also dynamicly display its progress on the page. Is there a way to do that?

Dave S

unread,
Apr 6, 2015, 2:06:28 PM4/6/15
to web...@googlegroups.com


On Monday, April 6, 2015 at 3:16:35 AM UTC-7, BlueShadow wrote:
Hi,
I have a function in my web2py app which takes quite a while. I like to have a button on a page which starts the funktion but does not reload the page for 10 minutes. The function should also dynamicly display its progress on the page. Is there a way to do that?


I would look at using ajax.  On the first call, use the scheduler to start the long computation,  and the call also sets a cookie, and activates a "busy" display that uses a timer to make the second call.  The second call sees the cookie, checks for results, displays what it can, and if not done repeats the busy/timer activation.

I'm interested in using this technique myself, but haven't quite got the js down to do the equivalent of $(document)ready(), but I'm hoping someone can fill in that gap.

Dave
/dps




Kevin Bethke

unread,
Apr 7, 2015, 6:11:51 AM4/7/15
to web...@googlegroups.com
thanks that will give me at least a starting point. Until you wrote I had no idea what I have to look at. I would be interested in your progress if you like to share

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/XasQq3GgrH4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dave S

unread,
Apr 7, 2015, 1:42:38 PM4/7/15
to web...@googlegroups.com


On Tuesday, April 7, 2015 at 3:11:51 AM UTC-7, BlueShadow wrote:
thanks that will give me at least a starting point. Until you wrote I had no idea what I have to look at. I would be interested in your progress if you like to share


I've posted my single-pass ajax sample recently (20s per load), and the archives have several other people's examples, but I haven't got far in the multi-pass version yet.

/dps

 
Reply all
Reply to author
Forward
0 new messages