[Zope] Inserting foldernames into propertysheet 'selection' dropdown

Jonathan Hobbs toolkit at magma.ca
Fri Jul 16 13:18:09 EDT 2004


From: "Gary Duke Speer" <zope at cortech.org>
> I'm looking for syntax to properly pass folder names as a list to a
> propertysheet selection property.
>
> Every syntax I try gets:
>   Error Type:  In Error
>   Error Value:  Strings are not allowed as input to the in tag.
>
> The propertysheet has property 'selectfolder' of type 'selection' set to
> look to a method 'getfolders' for the list of options.
>
> The documentation says this property type wants either a list or tokens.
>
> One example:
> A dtml method named 'getfolders' contains
> <dtml-in "objectValues(['Folder'])><dtml-var id> </dtml-in>
> And renders space separated tokens.

If you are trying to create a list variable which you then store as a
property field, try something like

<dtml-call "REQUEST.set('alist', [])">
<dtml-in "objectValues(['Folder'])">
  <dtml-call "alist.append(id)">
</dtml-in>

you can then store the variable 'alist' in a property field on a folder (in
this case 'somefolder'), eg.

<dtml-call "somefolder.manage_addProperty('alist', alist, 'lines')">

you can then access the list by:

<dtml-in "somefolder.alist">
  <dtml-var sequence-item><br>
</dtml-in>


HTH

Jonathan




More information about the Zope mailing list