[Zope] RE: How to prime a selection?

RC Compaan roche@up-front.co.za
Fri, 4 Aug 2000 07:41:34 +0200


Hi Jean

The value for a selection list can be any zope object that returns a list
eg. MyDocClass can have a property "Format" with a value "FormatList", where
FormatList is a dtml-method that returns a list.

Practically:
1.Go to the property sheet for your new class and add the property Format
with value FormatList.
2.Go to the Folder where you want to add an instance of your ZClass and
create add a property "docformats" of type "lines" and enter the initial
formats.
3.In the Folder where you want to add your instance, create a dtml-method
called "FormatList" that will return the list, containing:
	<dtml-return docformats>

Hope this helps.

For more info on selection list see
http://www.zope.org/Members/AlexR/SelectionLists

Roché

> -----Original Message-----
> From: Jean Jordaan [mailto:Jean@mosaicsoftware.com]
> Sent: 04 August 2000 07:10
> To: 'zope@zope.org'
> Cc: RC Compaan (E-mail)
> Subject: How to prime a selection?
>
>
> Hi all
>
> I'm making a document class for a warehouse of papers.
> It's based on ZCatalogAware and ObjectManager (to wrap
> mainly PDFs and DOCs), and has fields:
>
>   title   (string type)
>   origin  (string type)
>   format  No value for format_value.
>   type    No value for type_value.
>
> "format" and "type" are selections --
>
> 1. where do I supply their initial values (filling in
>    'format_value' and 'type_value')?
> 2. is it possible to let a field offer presets and
>    previously entered values, but to allow users to
>    add new ones, which are remembered and offered to
>    subsequent users?
>
> A RTFM-type answer to question 1. is perfectly OK, though a
> page reference would be sorely appreciated.
>
> --
> jean
>