[Zope] Zope 1.11.0pr11 new folder properties - selection
Martijn Pieters
mj@antraciet.nl
Fri, 07 May 1999 13:14:43 +0200
At 12:14 07/05/99 , Dr. Ross Lazarus wrote:
>Anyone figured out how to use the 2 intriguing new kinds of properties
>on the dropdown list of choices available from the "add" section of the
>"properties" tab menu of folders in 1.11.0pr11 ?
>
>In particular, what's the syntax for the value of a selection or a
>multiple selection ?
>
>I can put things like prestuffed dictionaries in like {a:1,b:2,c:3,d:4}
>for a multiple selection ("selection" seems to be broken) but when I
>display using just a <!--#var "thing"--> I just get a string - I'd hoped
>it might have been rendered as a picklist ?
>
>Any advice gratefully accepted.
These two properties are still experimental, and multiple selection is even
broken in 1.11pr1. I submitted fixes for these.
The idea is, that the select, or multi select box displays the values of
another list type property. That property is named by the select_variable
property. An example will be clearer:
Say, you have a property named 'colors', of type tokens, containing the
string 'red green yellow blue'. The value of that property is then a list
with the values 'red', 'green', 'yellow', 'blue'.
You can now set a string property named 'select_variable', value 'colors',
and a property of type 'selection', named 'color_select', value 'yellow'.
The property sheet will then display a drop-down box containing the values
from 'colors', with 'yellow' pre-selected.
If you now change this selection to, say, 'blue', and click on 'Save
Changes', the box will show that selection. Also, referring to the
'color_select' property will yield the value selected (in this case 'blue').
Multiple selection should work in the same fashion, if only there were no
typos in it's implementation. If it works, it's value will be a list with
all elements that were selected in the property page.
I think DC is still developing on this. There are still a number of
limitations. You can have only one list of elements for all selection boxes
on a given property page (they all take their values from the property
named in 'select_variable'). You can't use the results of a method call as
a source list (I personally would use it to display a dropdown list of all
image ids available for example).
--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-6254545 Fax: +31-35-6254555
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------