On Thursday, March 3, 2016 at 6:18:00 AM UTC-8, Yebach wrote:
>
> Hello
>
> I have call to controller function on button click that serves back a 
> download file. 
>
> Since this can take a while (up to 10 seconds), i would like to create 
> some sort of progress bar or smth for user so he/she knows smth is going on 
> in the background and does not click 10 times.
>
> Any solutions/suggestions?
>  
>

If you're using the LOAD helper, the content arg specifies a message to 
display.

{{loadmsg = CAT("loading ...", BR(), SPAN(_class="fa fa-spinner fa-spin"))}}
{{=LOAD(c='makestuff', f='stuff2.load', target='my_stuff', content=loadmsg, 
ajax=True)}}


fa-spinner is an object that the browser animates via CSS, but you can put 
text, or other stuff there (I have also used a font that provides 
animation)).  Someone in the group pointed me at the resource, which is a 
website that generates a CSS clip based on your choice of colors, etc. 
 Someone in the group pointed me at it, so the URL should be in the group 
archives.

If you're using ajax directly, I think you'd want your onclick function to 
display your "loading" message  before calling ajax().

If you are providing a button or link that is just directing the user to 
another page, you may want an onclick handler to display a flash message or 
unhide a "please wait" message.

This is a javascript issue, mostly (AIUI).

/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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to