[Grok-dev] schema.List widget with non-unique values from a Choice

Sebastian Ware sebastian at urbantalk.se
Wed May 13 10:25:19 EDT 2009


...in the generated javascript :)

Mvh Sebastian

13 maj 2009 kl. 16.23 skrev Sebastian Ware:

> This works:
>
>   contact_type = schema.List(title=u"Typ",
> value_type=schema.TextLine(), required = True, unique=False,  
> default=[])
>
> so your assumption seems to be correct
>
>   contact_type = schema.List(title=u"Typ",
> value_type=schema.Choice(vocabulary = 'Contact Types'), required =
> True, unique=False)
>
> I believe the offending line is found in
>
>   function moveItems(from, to)
>
> near the end:
>
>         // delete moved item in source
>         src.options[src.selectedIndex] = null;
>
> I guess it is a bug...
>
> Mvh Sebastian
>
>
>
> 13 maj 2009 kl. 10.28 skrev Jeroen Michiel:
>
>>
>>
>> Sebastian Ware wrote:
>>>
>>> Try something like:
>>>
>>> contact_type = schema.List(title=u"Typy",
>>> value_type=schema.Choice(vocabulary = 'Contact Types'),  
>>> unique=False)
>>>
>>> Mvh Sebastian
>>>
>> Well, that's actually what I started out with, but that doesn't seem
>> to
>> work: apparently the unique parameter is not taken into account while
>> rendering the widget, so you can't add' doubles' into the list.
>> -- 
>> View this message in context: http://www.nabble.com/schema.List-widget-with-non-unique-values-from-a-Choice-tp23349366p23517542.html
>> Sent from the Grok mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Grok-dev mailing list
>> Grok-dev at zope.org
>> http://mail.zope.org/mailman/listinfo/grok-dev
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> http://mail.zope.org/mailman/listinfo/grok-dev



More information about the Grok-dev mailing list