Flash messages

76 views
Skip to first unread message

Maurice Waka

unread,
Apr 4, 2018, 5:37:07 AM4/4/18
to web2py-users
In web2py we have flash messages such as 'Success' when form is accepted etc. 
Is there a way to have an animation flash with a  message such as 'loading', 'Please wait' in web2py as the page reloads?
*** My pages sometimes take a few more seconds to open e.g. switching from index  page to other html.views.
Kind regards

Dave S

unread,
Apr 4, 2018, 5:12:58 PM4/4/18
to web...@googlegroups.com

This isn't in the flash, but I have this in one of my views:

<DIV id="my_hosts">
   {{=LOAD(c='thosts', f='thosts2.load', target='my_hosts', ajax=True)}}
       
<span id="jsoffs">Javascript off?  <a href="thosts2.html" id="jsoffa">Click here</a></span>
       
<br>
       
<span class="fa fa-spinner fa-spin"></span>
   
</DIV>



My first attempt at putting this in a flash message  (seesion.flash for the page I was working with, because it does a redirect) didn't do anything

/dps

 

Maurice Waka

unread,
Apr 5, 2018, 5:48:02 AM4/5/18
to web...@googlegroups.com
Dave. Did you send a blank message? 

On Thu, 5 Apr 2018, 00:13 Dave S <snide...@gmail.com> wrote:


On Wednesday, April 4, 2018 at 2:37:07 AM UTC-7, Maurice Waka wrote:
In web2py we have flash messages such as 'Success' when form is accepted etc. 
Is there a way to have an animation flash with a  message such as 'loading', 'Please wait' in web2py as the page reloads?
*** My pages sometimes take a few more seconds to open e.g. switching from index  page to other html.views.
Kind regards

--
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/gU1MOFTgeWs/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.

António Ramos

unread,
Apr 5, 2018, 7:49:35 AM4/5/18
to web...@googlegroups.com
I guess you have to use ajax to load the page
for example use js
jQuery('#target').html("<span class='icon-retweet'></span>LOADING...");  // this creates a spinner or a waiting message in the #target 

ajax('"yoururl", [], 'target');when data received, replaces the spinner..... in the #target

Just an example . I´m sure there is other options...


regards

--
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+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages