You want your ZClass instance edit form to correctly display
the currently selected values for a multiple selection

You have a ZClass that has a multiple select property named
'format' with a value set to 'format_list'.

You have a 'format_list' lines property set where the ZClass
*instances* can acquire it.

You generated an 'Edit' type 'Property Sheet Interface' that
contains the following code:

  <tr><th align=left valign=top>format</th>
      <td align=left valign=top></td>

Replace the above code with the following:

  <tr><th align=left valign=top>format</th>
      <td align=left valign=top>
        <select name="format:list" multiple size="4">
          <dtml-in format_list>
          <dtml-if "_['sequence-item'] in _['format']">
          SELECTED</dtml-if> >
          <dtml-var sequence-item></option>

This will correctly display the currently selected values
for your ZClass instance in the edit form, and capture the
changed values when the form is submitted, casting even
single selections to a list.

Note: If the 'format_list' lines property is set where the
Zclass instances can acquire it, but not where the ZClass
definition can acquire it, then the Property Sheet
management screen will *not* display the values. If you want
to provide a default set of values that the ZClass
definition can acquire as well as the ZClass instances (of
course you can also override this locally), set the
format_list property on the root folder.


Michael Bernstein.

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to