[Zope] Zope not listening to trinkets
Jason Spisak
jason@mtear.com
Thu, 23 Sep 1999 07:21:38 GMT
Martijn,
Could I also use sequence-item as in:
<dtml-in things>
<input type=hidden name="things:list" value="&dtml-var
sequence-item;">
</dtml-in>
> 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.
Jason Spisak