[Zope] dtml-in loop to capture records

Paul Zwarts paul.zwarts@oratrix.com
Thu, 12 Oct 2000 16:24:07 +0200


Hi all,

I have a number of simple forms that retrieve all occurences of a table
into editable fields in a page. Each input tag is named:

<table stuff>
<dtml-in getList>
     ...
     <input type="hidden" name="item.fieldname:records:required"
value="&dtml-fieldname;">
     ...
</dtml-in>
</table>

Note, only the primary key field is actually a hidden type input and the
rest are text and so on.

In test of the submit button, the dtml-sql method called is structured:

<dtml-in item>
update table
set
field2=<dtml-sqlvar field2 type=nb>
where field1=<dtml-sqlvar field1 type=nb>
&dtml-sql_delimiter;
</dtml-in>

and the conditions of the method are item:records.

The intention is to submit in one go the entire list of occurences and
update anything that has changed. You can do this with checkboxes valued
on the primary key and other ways. The important thing is to leave
something that you use as the key in the WHERE statement.

Okay, this works fine, in MOST of my forms, but I have other forms where
this doesnt work at all and I get errors saying that the ITEM is a bad
request. I dont get it, what am I missing here that this works some
places and in other places with almost identical syntax, it falls over.

The form is correctly tagged, does the name attrib of the form tag have
to do with the <dtml-in item>... doesnt seem to be but tried it. Im
wondering if because the dtml-document is quite large with seperate
subloops and forms that publish in a sequence of events that this doesnt
work.

Hopefully someone has insight I'm missing here?

Cheers and thanks again,

--
Paz
Oratrix Development BV
http://www.oratrix.com
GRiNS SMIL Editor
-