[Zope] How do I edit values of items created using Property Sheets

R. David Murray bitz@bitdance.com
Mon, 20 Mar 2000 14:16:30 -0500 (EST)


On Mon, 20 Mar 2000, Ed Corrado wrote:
> objects. While this is a start, it really isn't ideal. As Nick Henderson
> suggested, it would be better if there was a way to do this from standard
> DTHML, so that the editing form looks like a filled-in entry form? Does

I'd really like to see a global method that replicates the property sheet
editor but is callable from code rather than the management interface
and can thus be "wrapped"...

There is some sample code somewhere that shows how to mostly do
this in DTML.  I looked at it, but wound up just creating my own
specific editing form anyway, because I couldn't get it to run
out of the box and didn't have time (or at that point the knowledge)
to debug it.

> and person #2 calls it "Time Magazine." Does anyone know of a way to take
> the existing values of an entry and pull it into a select list and tell
> the list to keep them "selected," or have an idea of a direction to go
> in order to attempt this?

Here's a snippet of code from my custom edit form that does this for
a multiple select property I have.  Hopefully this will help you roll
your own.  'regions' is a lines property defined on another propertysheet
(named 'constants' <wry grin>).  I haven't yet figured out how
to call this variable so I can use it in the addForm.)  I basically
copied this out of that sample code I mentioned above.

  <tr>
    <th><label id=in_regions>In Regions</label></th>
    <td>
      <select name="in_regions:list" multiple size="7">
        <dtml-in regions>
          <option <dtml-if
            "_['sequence-item'] in in_regions">SELECTED</dtml-if
          >> <dtml-var sequence-item></option>
        </dtml-in>
      </select>
    </td>
  </tr>  

--RDM