[Zope] Newbie Question: Create Table Interface

Anthony Pfrunder s341625@student.uq.edu.au
Tue, 17 Aug 1999 12:04:51 +1000 (GMT+1000)


On Tue, 17 Aug 1999, [iso-8859-1] Roché Compaan wrote:

> I want to create a interface for creating tables (if there isn't one
> already).  The layout of the form would be similar to the form where you add
> properties for objects in Zope.

Check out the ZTables contributed product on the Download page.
 
> Question1:
> How do you then define a list variable in the dtml document that is only
> used while busy with the form?

Use <dtml-var "REQUEST.set('name', '[]')"--> and <dtml-var
"_['name'][index] = value"-->.  There is explict support for lists in
forms but cannot recall it currently.

> Question2:
> If I add a column to the list, how do I tell Zope to render the same dtml
> document and update the list?

On your form, set the target in your action button to point to the same
page and unpack the new list from REQUEST.forms and rebuild the page.
Esstentially, the user adds stuff to a form, the "Submit" reloads the same
page with the new data via a query string.  Zope then uses the new data
(prehapes with if statements) to rebuild the page. 

> Thanks for your help.
> Roché  

Cheers,
Anthony Pfrunder