thanks Val K

still there's something unclear:
the book implies that a new widget is just a function and a field 
definition bound to that function like:

def my_string_widget(field, value):
    return INPUT(_name=field.name,
                 _id="%s_%s" % (field._tablename, field.name),
                 _class=field.type,
                 _value=value,
                 requires=field.requires)

Field('comment', 'string', widget=my_string_widget)

but if you look at the web2py code 
:https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L321
a widget is a class with a static-method in it so my question is :
do I have to define a new widget class like : class myListWidget(StringWidget) ?
or is it enough to define a function as the book says ?

what's perfectly clear (Niphlod) is the need to define a new css class (!= 
w2p_*) for the new widget


-- 
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