My TableForms are dynamically generated so I needed to set the checked
state upon instantiation. I tried using the value parameter during
object creation:
for_widget = CheckBox(name="your_checkbox",  value=True,
help_text="Just click me...")

And I get the following warning:
/usr/lib/python2.4/site-packages/TurboGears-1.0.3-py2.4.egg/turbogears/widgets/base.py:190:
UserWarning: keyword argument "value" is unused at 'CheckBox' instance
 warnings.warn('keyword argument "%s" is unused at %r instance' % (

Should I be able to?

Thanks for the speedy fix.

-Brian

On 7/23/07, Christopher Arndt <[EMAIL PROTECTED]> wrote:
>
> 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