helpers correspond to tags and they are represented as trees. The root
of the tree is the tag itself and the children are the tags contained
within. The FORM helper has a special accept method that performs the
tree traversal and finds all nodes which are INPUT, TEXTAREA or SELECT
and process them.

SQLFORM just builds a particular tree structure.

FORM lets you build any tree structure you want.

You can already create and store subtrees (like a fieldset) and insert
them into an existing FORM/SQLFORM. The problem is naming conflicts.

I see different needs from your emails, and correct me if I am wrong.

1) FORM currently does not understand Field objects and their widgets.
SQLFORM does. Perhaps FORM should thread Field objects as special
helpers themselves. So you can insert Fields directly in the tree
structure of a FORM, not just a SQLFORM. This is not easy but can be
done. Yet, this would go in the direction of adding presentation logic
into the controller. Not what users normally like.

2) Have custom forms that contains multiple instances of the same
field. There cannot be two INPUT fields in the tree with the same
name. This is a HTML constraint and by-passing it would require that
field names in form no longer correspond to variable names in web2py.
Perhaps there should be a way to rename fields when inserted in the
tree?

3) Decouple completely the logic content of a form (the set of leaves
that are INPUT fields) from their representation (the tree structure).
Are there forms other than HTML forms? No. That is why they are
coupled. Decoupling means a INPUT field no longer knows its place in
the page and this may be a a problem when displaying errors for
example. It would also cause the FORM object to be a new kind of
animal from regular helpers. Anyway. It can be done bt it would
require the introduction of a new type of form object that is an
alternative and not compatible with the current one. It seems to me
this decoupling is not related and would not address any of the issues
1) and 2), and it would only make lots of stuff more complex that
needs to be.

Massimo

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to