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

Martijn Pieters mj@antraciet.nl
Sun, 17 Oct 1999 07:15:23 +0200


At 02:59 17-10-99 , Ian Blenke wrote:
>(WARNING, This doesn't work... perhaps someone can tell me why)
>
>         In MyTestProduct, populate MyFirstOptionList and MySecondOptionList
>in the Product properties.
>
>         In MyTestZClass_add:
>
>         <dtml-with "MyTestZClass.createInObjectManager(REQUEST['id'],
>REQUEST)">
>           <dtml-call "REQUEST.set('MyFirstOptionList',
>_['MyFirstOptionList'])">
>           <dtml-call "REQUEST.set('MySecondOptionList',
>_['MySecondOptionList'])">
>           <dtml-call "propertysheets.Basic.manage_editProperties(REQUEST)">
>         </dtml-with>

Because of the with tag, you are inside the namespace of your newly created 
ZClass instance. _['MyFirstOptionList'] (or just plain MyFirstOptionList) 
will retrieve the MyFirstOptionList of that instance, which is empty.

You can copy the value using a let tag:

  <dtml-let def1=MyFirstOptionList def2=MySecondOptionList
   <dtml-with "MyTestZClass.createInObjectManager(REQUEST['id'], REQUEST)">
     <dtml-call "REQUEST.set('MyFirstOptionList', def1)">
     <dtml-call "REQUEST.set('MySecondOptionList', def2)">
     <dtml-call "propertysheets.Basic.manage_editProperties(REQUEST)">
   </dtml-with>
  <dtml-let>

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| T: +31 35 7502100 F: +31 35 7502111
| mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
---------------------------------------------