Thanks (roger) for the tips. I was trying to use a single custom widget - taking that out gave the expected default behaviour. I needed a much more customised form, so after many false steps, and for the benefit of anyone else who needs to know this is what I did:

1. Put an 'update' method definition in the thingy content type Interface and Class Implementation.

2. Created a custom thingy Page Template for the edit form.

3. Used template="" and class="site.thingy.thingyClass" definitions in the editform configuration. (No custom widgets.)

Seems very simple! I guess the problem for the Zope 3 newcomer is knowing which bits if the framework to use and which to replace.


Roger Ineichen wrote:
Hi Cliff


[mailto:[EMAIL PROTECTED] On Behalf Of Cliff Ford
Sent: Thursday, April 14, 2005 9:43 AM
Subject: [Zope3-Users] Form for list of lists

I have a list of lists that I need to manipulate with a form. I have figured out how to get the list elements into a form with a Page Template. However, the field names come out like this:

0 field.listname.0. field.listname.1. field.listname.2.
1 field.listname.0. field.listname.1. field.listname.2.
2 field.listname.0. field.listname.1. field.listname.2.

where the first integer is just the value of repeat/item/index and the first element represents listname[0][0].

I have a widget derived from SimpleInputWidget to handle the form elements (all strings).

I don't know how to get the updated form values back into the list of lists, or even the best/correct approach to this whole problem. Can anyone provide some pointers?

Use the Field "List" in your interface for describe the list attribute.
Then use the standard "editform" directive with the right schema and all is handled by the form framework.

Then you should get values like: field.list.1name.1

If you like to use a own edit form, you can call
request.get('yourfieldname', None)
for get a value. But make sure the fields have unique numbers.
Right now it seams each row uses the same numbers.

Roger Ineichen


PS: Has yesterday's question from Dylan Reinhardt been answered off-list? I will be doing the same thing next and was interested in any answers.
Zope3-users mailing list

Zope3-users mailing list

Reply via email to