[web2py] component (LOAD)

133 views
Skip to first unread message

Richard

unread,
Nov 12, 2012, 1:38:19 PM11/12/12
to web...@googlegroups.com
Hello,

I would like to know if we have fine control over which component is loaded or not on a page. What I would like to do if it possible is to put many components in differents tabs on the same page, but only trigger the loading of those component when the user actually it the tab (to limit overhead caused by the multiple form embeded into the page). Then I could allow my users to navigate (cross navigation) with those tab (or side menu) between differents form without losing their input. For sure I will have to reload some component if the elements inserted into other form required it and keep the data.

Thanks

Richard


Anthony

unread,
Nov 12, 2012, 1:58:22 PM11/12/12
to web...@googlegroups.com
You can use Javascript to dynamically load a component on the client side based on user input/activity. Just call the web2py_component() function directly. It's a Javascript function in web2py.js. The first argument is the URL of the component, and the second is the ID of the target div where you want the component to load.

Anthony

Richard Vézina

unread,
Nov 12, 2012, 2:52:41 PM11/12/12
to web...@googlegroups.com
Thanks I will play with that soon.

Richard

--
 
 
 

Richard Vézina

unread,
Apr 23, 2013, 1:17:10 PM4/23/13
to web2py-users

Arnon Marcus

unread,
Apr 23, 2013, 6:44:36 PM4/23/13
to web...@googlegroups.com
???
Is this like a "single-page-application" implementation?
When did that happen?

Richard Vézina

unread,
Apr 23, 2013, 8:06:44 PM4/23/13
to web2py-users
web2py_component() let you trigger when you want the LOAD or component is loaded... In my case, I don't want many tables to load at the same time, because it slow don't the app... So, I let to my user the control to load or not the component if the need it. I acheive that by embeded my compenent into a bootstrap accordion and when the user it the header of the accordion the loading of the component is trigger... But I am sure it could be use in many diverse way...

Richard 



--

---
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Reply all
Reply to author
Forward
0 new messages