[Zope] Dynamically generating fielsd in a form

aborel borelan@wanadoo.fr
Wed, 15 Jan 2003 11:07:02 -0400


Hello,

Some questions on tal:repeat.

1) Generating fields

I have an object called 'process'
this object contains a list of steps to follow to perform the process.
A step have a type that may be 'unique' or 'repeated'
	For example : an invoice
	CustomerId : Unique step
	ProductId  : Repeated step (number of repetitions undefined)
			ProductId : 1 (sub-step)
			ProductId : 2 (sub-step)
			...
			ProductId : n (sub-step)(repeated until user 					chosees next step)
	NetDue     : Unique step

What i want to do is to generate fields steps by step depending on the
type of the step by using tal:repeat to loop over the list of steps and
display the rights fields.
A 'unique' step will have one submit button : Next Step
A 'repeated' step will have to submit buttons : Validate (to fill in a
new sub-step) and Next Step.
Tal:repeat is useful on 'uniqu'e steps  but when i encounter a
'repeated' step, i can't use it as it's not a sequence and the number of
repetitions is undefined.

Any Suggestions will be greatly appreciated.

2) Validating fields

Is it possible to use Python scripts instead of Ecma scripts on core
events like onBlur, Onclick and so on ?

3) Displaying the fields

Each time a field is filled in, i'd like to display it at the end of a
listing without re-redenring all the web page, just the changes
(understandable ??? ;-)).

How this is managed ?

4) Storing the generated objects

The form template will be called from various place on the site so how
do i indicate the exact place to store the generated objects ?

Thanks

Andre