Karl Guertin wrote:
> On 2/10/06, Kevin Dangoor <[EMAIL PROTECTED]> wrote:
> > Karl may have some thoughts on this, because he's been thinking about
> > compound widgets a bit.
>
> The compound widgets I've been thinking about are probably better
> called containers or nested forms. I've thought about this problem a
> bit but didn't come up with a good general solution (I wound up doing
> what Jason did).

One possible solution could be this?

First of all, add a special method that returns a list of the names a
CompoundWidget is managing:

def children_names(self):  (better name needed)
     return #a list of the names

Then when we prepare the values that we pass to the widget on form
display we use this method to retrieve the name list and pass any
name/value pair at the display method.

Also note that the new Form implementation has the field_for method
that gives you more freedom and control over parameters passed to a
field, you can do something like this:

${form.field_for("name").display(your parameters)}

By the way you loose the ready-to-display-template part of the widgets
concept in this way.

Ciao
Michele

Reply via email to