[Zope] tricky form handling

Thomas Duterme tduterme@hotmail.com
Thu, 27 Jan 2000 11:59:31 PST


BRAIN TEASER!

I've got a brain teaser for the list.  here's my form:

<form>
<table border=1>
  <dtml-in "objectValues(['Reason2'])" reverse size=10>
   <dtml-if "publish=='on'">
   <tr><td><input type="checkbox" name="good:list" value="<dtml-var id>">
   <td><dtml-var reason>
   <td><dtml-var count>
   <td><dtml-var publish>
</dtml-if>
</dtml-in>
</form>


Now the goal is to increment the count on objects which are checked in the 
previous form (ie are part of 'good'). Here's what I came up with but it 
doesn't quite work.  It increments the count property on all the objects 
listed.


<dtml-in "objectValues(['Reason2'])" reverse size=3>
<dtml-if "publish=='on'">
<dtml-if "REQUEST.has_key('good')">
<dtml-call "REQUEST.set('thelist', good)">
  <dtml-in thelist>
     <dtml-call "REQUEST.set('count', 
_.int(_[_['sequence-item']].count)+1)">
     <dtml-call 
"propertysheets.properties.manage_changeProperties(REQUEST)">
     </dtml-if>
   </dtml-in>
</dtml-if>
</dtml-if>
</dtml-in>

First one who can provide the answer (thus correcting my mistakes and 
illuminating the list) gets 5 Zope stars!

TIA,
Tom
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com