Inserting foldernames into propertysheet 'selection' dropdown
Happy Friday - 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. My question is how to change this to produce a list in a format that the property will accept. Thank you for any guidance! Duke
From: "Gary Duke Speer" <zope@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
participants (2)
-
Gary Duke Speer -
Jonathan Hobbs