Hi, 

I'm still searching, and I found in the web2py book something like this in 
widget section:

The "options" widget is used when a field's requires is IS_IN_SET or 
IS_IN_DB with multiple=False (default behavior).


I assumed, that if I change the 'requires' of field (after 
SQLFORM.dictform, see bellow), than the widget will change automatically, 
but it seems not working that way. What I should also change to get select 
in view (now it is still [probably default] input  field) ?


W dniu sobota, 4 stycznia 2014 18:26:10 UTC+1 użytkownik brushek napisał:
>
> Hello :)
>
> I have following code in controller:
>
> session.config = dict(NAME = 'a')
> form = SQLFORM.dictform(session.config)
> form.custom.widget.NAME <http://form.custom.widget.name/>['requires'] 
> =IS_IN_SET
> (('a','b','c','d','e'), error_message="Choose between a and e")
>
>
>  if form.process().accepted: 
>         session.config.update(form.vars)
>
>
>
> validator is working OK, but I would like to change the type of NAME field 
> in form to select dropdown, instead simple input. How to do this ? How to 
> change the type of field after it is created by any SQLFORM(.*)  ?
>
> Regards
> brushek
>

-- 
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/groups/opt_out.

Reply via email to