[Zope] Re: Zclasses + 'selection' and 'multiple selection' property types

Martijn Pieters mj@antraciet.nl
Mon, 19 Jul 1999 15:21:48 +0200


At 23:52 16/07/99 , Alex Rice wrote:
>Martijn> If you choose type 'multiple selection', 'colours' will hold a
>Martijn> list of 0 or more values from the 'colours_list' list, which
>Martijn> the user can select from the scrolling list. The height of the
>Martijn> listbox is either 7 or the number of elements in 'colour_list',
>Martijn> whichever is the smallest.
>
>What do you enter for the initial value when creating a property of
>'multiple selection' type?

You can't, I filed a bugreport for this. Can't remember what workaround I used.


>Martijn> Patch to properties.dtml to support this:
>
>Not sure why the patch would not patch, but after you mailed me your
>properties.dtml, it became obvious your approach. This works perfectly
>for normal objects (like DTML Docs) However, this *doesn't* work with
>ZClasses, and I'm not sure why not. Any ideas? It's as if _.has_key() is
>not working correctly for ZClasses. Here is what I did:
>
>1) Apply your version of lib/python/OFS/properties.dtml, restart zope
>2) Create Product 'Colors'
>3) In Colors, add ZClass 'color'
>4) In color add a propertysheet 'info'
>5) In info, add tokens property colors_list = "red green blue"
>6) Add string property colors_select_variable = "colors_list"
>
>   [ now colors_select_variable definitely exists and is displayed]
>
>7) Add selection property colors = "red"

Bother. I had a feeling this wouldn't work. DC, can you make this work?

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------