[Zope] Re: Inserting foldernames into propertysheet 'selection' dropdown

Gary Duke Speer zope at cortech.org
Fri Jul 16 12:36:09 EDT 2004


I received a great suggestion that seems to be on the right track,
but I am hitting a namespace issue.
The suggestion was to convert the string of folder ids to a list using
'string split'.
I'm hitting the error "global name 'objectValues' is not defined".

Where I am at:
Propertysheet has property 'selectfolder' of type 'selection' that obtains
it's list from the method 'returnfolders'

DTML Method 'returnfolders' contains
<dtml-return "_.string.split(getfolders(),' ',0)">
to parse the string of space-separated folder names from 'getfolders' into
a list.
By itself, this works.

DTML Method 'getfolders' contains
<dtml-in "objectValues(['folder'])"><dtml-unless hidefolder><dtml-var id>
</dtml-if><dtml-in>
to generate the filtered list of ids.
By itself, this works.

When 'returnfolders' executes 'getfolders' it returns an error -
'objectValues is not defined'.
I tried the underscore namespace, '_.objectValues...' with no success.
Any ideas?
Thanks,
Duke

----- Original Message ----- 
From: "Gary Duke Speer" <zope at cortech.org>
To: <zope at zope.org>
Sent: Friday, July 16, 2004 9:33 AM
Subject: 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
>



More information about the Zope mailing list