Brian Cole schrieb:
> for_widget = CheckBox(name="your_checkbox",  attrs=dict(checked=True),
> help_text="Just click me...")
> 
> This is misleading because it made me believe I could do the following
> to uncheck the box:
> for_widget = CheckBox(name="your_checkbox",
> attrs=dict(checked=False), help_text="Just click me...")

Yes, your're right. To set the checked state of the widget, one should
set the "value" param instead.

>>> cb = CheckBox(name="your_checkbox", help_text="Just click me...")
>>> cb.render(value=True)
'<input type="checkbox" class="checkbox" checked id="your_checkbox"
name="your_checkbox">'

>>> cb.render(value=False)
'<input class="checkbox" type="checkbox" id="your_checkbox"
name="your_checkbox">'

And the example in the Widget Browser should use "default".

class CheckBoxDesc(CoreWD):
    for_widget = CheckBox(name="your_checkbox",
                          default=True,
                          help_text="Just click me...")
    ...


I fixed this in Subversion in branch 1.0 and 1.1.

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