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
On Thu, Jan 27, 2000 at 11:59:31AM -0800, Thomas Duterme wrote:
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!
See the threads about 'REQUEST.set not incrementing' from this list. Basically, you need some spaces: 'count) + 1' not 'count)+1' -- pity this busy monster, manunkind, | Dennis Moore | Sarah not. Progress is a comfortable disease. | rainking@frenzy.com | McLachlan -e.e. cummings: One Times One | archon on the irc | "Black" If I cried me a river of all my confessions would I drown in my shallow regret?
participants (2)
-
Dennis Moore -
Thomas Duterme