[Zope] ZClass propertysheet: Selection/Multi selection/Token - how?

Ian Blenke icblenke@2c2.com
Sat, 16 Oct 1999 16:34:30 -0400


Attempting to fight my way through a simple ZClass Product, I've run up
against an apparently undocumented roadblock.

The task: Implement a Zope Product ZClass for an Object that is merely an
input form. The input forms will be thrown into a folder with
ZCatalog/ZSearch to find previously entered forms. Simply put: let the user
enter a pageful of form data and store it away for later retreival in a
Folder.

The problem: Some of the input fields are selection dropdown lists and
multiple-selection lists that represent fixed options. These options will
have spaces in them (killing a :token implementation). These options will
need to appended to in the future.

The idea: Create TinyTables as ZClass methods to enumerate the :list of
items that are needed in the selection dropdown list.

The attempt: Unsuccessful. No matter what I try to do, the propertysheet
shows "No Value for fieldname" - or whatever I name the TinyTable to be. 

The working solution: Instead of using TinyTables, I can implement DTML
Methods that merely return a list of options. For example, if you put the
following inside a DTML method:

	<dtml-return "('This is the first option','This is the second
option')">

you can reference the DTML method as the source variable for the
selection/multi-selection variable name.

But this isn't something I want to force upon the other adminstrators of the
site.

Perhaps the real question is "how do I efficiently manage lists of options
for forms without resorting to SQL?"

- Ian C. Blenke <ian@blenke.com> <icblenke@2c2.com>