Hi Ed,

1) change:

params = ["fieldsets"]

to:

member_widgets = ["fieldsets"]

I told you about this in your last thread but you probably missed it,
it's quite important since fieldsets are not simple params but member
widgets of your form, you need this for validating and passing values,
also member_widgets are not overridable at render/display time.

2) change:

values=myformvalues

to:

value=myformvalues

I also suggest to change:

fieldsets=(MyForm())

into:

fieldsets=MyForm()

but that's not a big problem.

Ciao
Michele

Ed Singleton wrote:
> I can't seem to pass values into a nested forms.  It's probably a
> simple error on my part but I can't work it out to save my life.
>
> from turbogears.widgets import *
>
> class MultiFieldSet(Form):
>     template = """
>         <form xmlns:py="http://purl.org/kid/ns#";
>             name="${name}"
>             action="${action}"
>             method="${method}"
>             class="tableform"
>             py:attrs="form_attrs"
>         >
>         <div py:for="fieldset in fieldsets"
>             py:replace="fieldset.display(value_for(fieldset),
> **params_for(fieldset))"
>         />
>
>     </form>
>     """
>     params = ["fieldsets"]
>     fieldsets = []
>
> class FS1(WidgetsList):
>     f1 = TextField()
>
> class FS2(WidgetsList):
>     f2 = TextField()
>
> class MyForm(WidgetsList):
>     fs1 = FieldSet(fields=FS1())
>     fs2 = FieldSet(fields=FS2())
>
> myform = MultiFieldSet(fieldsets=(MyForm()))
>
> myformvalues = dict(fs1=dict(f1="one"),fs2=dict(f2="two"))
>
> assert "one" in myform.render(values=myformvalues)
>
> The assert fails for me.
> 
> Any help would be greatly appreciated
> 
> Thanks
> 
> Ed


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to