I'm sorry to say this but personally I think this widgets project is 
doomed to failure. Too many people have tried to combine ease of use and 
flexibility of forms in the past and failed. The sad fact is that we 
already have a widget for creating a submit button - you type "<input 
type='submit' value='Submit'/>" in a template.

I personally believe that there is mileage in widgets, Eg. helping to 
create forms, but not in creating the entire form itself. For example, 
with a bit of imagination:

<form action="foo" method="post">
<fieldset>
<legend>My Form</legend>
<p py:for="field in form.fields">
        <div py:replace="form.field.ParaContents()">Field contents here</div>
</p>
</fieldset>
<p class="submit">
        <div py:for="submit in form.submit_buttons">
                <input type="submit" name="${submit.name}" 
value="{$submit.value}"/>
        </div>
</p>
</form>

The fictional ParaContents() method would spit out the label, input, 
placeholder for validation failures, and maybe a description. There may 
be other methods for other situations. Or alternatively I'd just write 
out the HTML for those placeholders myself if I wanted some flexibility.

I honestly can't see a way of providing a <form> to </form> solution 
that provides the flexibility that people need in creating forms, while 
making them easier than actually writing HTML. Top marks if you guys can 
do it, but the way I see it is like this: HTML is easier than Python. 
Replacing HTML with Python has got to be something special.

And also don't forget that all this widgets stuff totally breaks Kid's 
"designer-friendly templating" point.

Steve Bergman wrote:
> Just in case anyone else might benefit from having this in the archive:
> 
> You can "turn off" the TableForm() provided submit button by turning it
> into a HiddenField by setting submit=HiddenField() in the form
> definition.
> 
> You can then create your own named submit button(s).  The "name"
> appears as a label to the left of the button, which is annoying.  But
> you can set label=' ' to make it invisible. (Note there is a space in
> there.) The "hidden" submit button's value does get passed to the
> method indicated by "action" as "formfield", so the method must be
> prepared to accept it.
> 
> I'd still like to know how to put the buttons side by side, though.
> 
> -Steve
> 
> 
> 

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to