[Zope] Zope not listening to trinkets

Martijn Pieters mj@antraciet.nl
Thu, 23 Sep 1999 13:38:34 +0200


At 22:32 22/09/99 , Jason Spisak wrote:
>This is in line with the previous email about the 'list' variable called
>'things' that is giving me back ['my_list_item1','my_list_item2'] for
>sequence-items instead of just the strings.  I looked at the form from
>which these values can and I am using:
>
><input type="hidden" name="things:list" value="<!--#var
>"REQUEST['things']"-->">
>
>a hidden value that I got froma previous form (Which was also a list)
>The sequence-items show up as strings fine on the page with the above
>code, but when I try to use the hidden filed to move it to the next
>page, Zope ignores the trinket.

You are putting the string representation of your 'things' list in to a 
hidden field, and that string representation is then marshalled in to a 
list of exactly one item, the string representation. This is because HTML 
has no concept of lists.

You should turn your list into a set of hidden field, one for each item on 
that list. By adding the :list modifier to the fieldname, Zope will then 
convert it back to a list when the FORM is posted again:

   <dtml-in things>
     <input type=hidden name="things:list" value="&dtml-things;">
   </dtml-in>

Note that I use the HTMNL entity notation here (&dtml-variablename;), which 
will HTML quote your value, so that any of the <, >, or " characters will 
not mess up the HTML.

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