Kevin schrieb:
> Okay I feel stupid :)

You shouldn't!

> Don't add the submit button to the WidgetList, instead do:
> 
> progress_note_form=widgets.TableForm(fields=ProgressNoteFields(),
>   ..., submit=widgets.SubmitButton(...))

Yes, that's a way to do it. Or subclass widgets.Form and change the
template, so that it doesn't have/use the submit attribute but relies
on a submit button being in the fields list.

> On Jun 7, 1:06 pm, Kevin <[EMAIL PROTECTED]> wrote:
>> "If, for some reason, you do want to manage the submit button
>> yourself, add a widgets.SubmitButton instance to your form. The form
>> widgets are smart enough to skip the default when that 
>> happens."http://docs.turbogears.org/1.0/SimpleWidgetForm?highlight=%28submitbu...
>>
>> The above does not appear to be accurate.

Yes, I'm afraid that's true. If feel somewhat responsible for that
document but I just carried over this statement from an old version.
Looking at the source I can see no support for the behavior mentioned:

class Form(FormFieldsContainer):
    ...
    member_widgets = ["submit"]
    ...
    submit = SubmitButton()
    ...

class TableForm(Form):
    template = """
    <form xmlns:py="http://purl.org/kid/ns#"; ...>
        ...
        <table ...>
            ...
            <tr>
                <td>&#160;</td>
                <td py:content="submit.display(submit_text)" />
            </tr>
        </table>
    </form>
    """

So it seems that the widget attached to the "submit" attribute is not
part of the "fields" widget list. I'm not sure what the role
"member_widgets" attribute is, though. Maybe someone with a deeper
knowledge of the inner workings of form widgets can set me right?

If not, the mentioned paragraph should probably updated.

Chris

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

Reply via email to