On Tuesday, August 4, 2015 at 12:01:56 AM UTC-7, reddyreddy wrote: > > Hello All, > > I have a script in Web2py private folder. Now Iam running it from command > line. > > But I want to run the script, when a button in html page is clicked. > > Can anyone let me know how can I do this. > > Is this a "short" script, finishing in about the same time as a normal controller event? If so, just go ahead with Manuele's suggestion. For a recent discussion of implementing a button, look at <URL:https://groups.google.com/d/msg/web2py/LrkBbVvrE9A/xf-joBY6LF4J>
The archives have other button examples (even one by me, which indicates it's easy to learn this stuff). If it is a script that takes a while to run, I'd have the button add a task to the scheduler, display a placeholder "wait for it" message, and then poll (javascript timer, I guess) for the results. I'm looking at doing that for a broadcast-gather_responses type of action, but haven't implemented it yet. (I'll be using a small db table for my results, I think, so the timer just queries that table until the end of the gather period.) /dps -- 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 the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

