ZClass propertysheet: Selection/Multi selection/Token - how?
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>
On Sat, 16 Oct 1999, Ian Blenke wrote:
Perhaps the real question is "how do I efficiently manage lists of options for forms without resorting to SQL?"
I use a 'lines' property to store the possible settings (myitemvalues) and create a selection property which gets its values from myitemvalues. This is a simple method, provided you only need to store a list of items rather than a list of tuples (in which case you would be better off with TinyTables). ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen
participants (2)
-
Ian Blenke -
Stuart 'Zen' Bishop