I admit I haven't looked at this files, but these are my thoughts on the general concept, so apologies if some of these comments don't directly reflect your exact proposal.
I like the idea of a slimmed down form generation process on the server, and there is a trend to greater rendering on the client side which this will help, whatever client side tools are used. I would prefer any new option to be able to generate json or a python object, so we can choose to render in the web2py views or client side as we wish. Personally, I like web2py because of python, and much prefer writing python code to javascript code, but often feel SQLFORM does a bit too much when I want to control the form layout more. I think the client side javascript rendering in general presents the following challenges: - javascript code itself is not as easy to read as python - it's much harder finding out what javascript does what and when on the client side, especially when a few different scripts and libraries are involved. - client side rendering can take time and things can look a bit messy until it is completed - extra work is need to keep track of the current state of the client side interface and allow bookmarks to the current state In particular adding more client side rendering in web2py in this way may have the following issues: - there are still a lot of different javascript libraries developing client side ui functionality, would web2py's own way of doing this get in the way? - separate code depending on whether you are using bootstrap, or some other layout system would involve duplication and more chance of bugs wouldn't it? - how will this affect forms within components? And what about when components are reloaded? On Friday, September 5, 2014 6:56:23 AM UTC+1, Massimo Di Pierro wrote: > > Please find attached a welcome4.zip with contains the following files: > > controllers/default.py > views/layout.html > vides/default/index.html > modules/jform.py > static/js/jform.js > static/js/jform-bootstrap2.js > static/js/jform-bootstrap3.js > > My proposal is the following: > 1) deprecate SQLFORM (but keep it for backward compatibility) > 2) replace > > form = SQLFORM(table).process() > ... > {{=form}} > > with > > form = JForm(table) > ... > {{=form}} > > what is the difference? SQLFORM generates html. JForm generates JSON > metadata which is then converted into the form client-side by the js in > jform.js. > why? > - it is much faster because all rendering is done client-side > - it can "optionally" submit the form via Ajax without having to change > your code. > - it is much easier to style and create widgets for different css > frameworks. > For example include the right one: > static/js/jform-bootstrap2.js > static/js/jform-bootstrap3.js (I only provide a layout for bs2 and not bs3) > - it is much more powerful because you can customize widgets in JS. > > We could also add a JTable, a JMenu and a JLogin and keep all the styling > info in JS files as opposed to Python files. > This would make web2py leaner and cleaner. > > Thoughts? > > Massimo > > > > > > -- 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.