If a list:<type> field has an IS_IN_SET or IS_IN_DB validator, by default 
it will get the MultipleOptionsWidget -- otherwise it will get the 
ListWidget. By default, list:reference fields get an IS_IN_DB validator, 
which is why you see the MultipleOptionsWidget by default for those fields 
(list:integer and list:string fields don't get any default validators, so 
they get the ListWidget by default). If you want to use the ListWidget, you 
either have to set requires=None for the list:reference field or explicitly 
set widget=SQLFORM.widgets.list.widget. However, you'll then have to enter 
record IDs into the list widget fields, which is probably not what you want 
to do.

Anthony

On Friday, February 3, 2012 11:06:40 AM UTC-5, monotasker wrote:
>
> That's good news. I'm a bit confused, though, since it doesn't seem to be 
> the default widget for list:reference fields, which are presented by 
> default in a multiple select widget (or does list:reference not fall under 
> list:<type>?).
>
> Also, the list widget isn't included in the list of available widgets on 
> pp. 372-373 of the 4th edition book. So maybe that Massimo could update 
> that section to include it.
>

Reply via email to