[Zope] convert #var sequence-item to integer?

Martijn Pieters mj@antraciet.nl
Tue, 10 Aug 1999 08:29:37 +0200


At 04:35 10-8-99 , Tim Potter wrote:
>Hello everyone.  I'm trying to iterate over a list returned from a
>form using #in and the sequence-item DHTML variable to index other
>lists.  It's the standard table of checkboxes thing to identify a
>group of rows to operate on.  My DHTML is:
>
><!--#in selections-->
>  <!--#let i=sequence-item-->
>    link_num = <!--#var "link_num[i]"--><br>
>    link_title = <!--#var "link_title[i]"--><br>
>    link_data = <!--#var "link_data[i]"--><br>
>  <!--#/let-->
><!--#/in-->
>
>The error I get is "sequence index must be an integer".  Zope doesn't
>seem to be converting the sequence-item variable into an integer
>before looking up the value in the list.  If I change sequence-item to
>sequence-index, everything works (except for the fact it returns the
>wrong data (-:).
>

If you define your checkboxes as :int:list they will be converted to a sequence
of integers.

-- 
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 
---------------------------------------------