[Twisted-Python] woven.widgets
Donovan Preston
dp at twistedmatrix.com
Fri Oct 4 12:28:15 MDT 2002
I think you may be able to set checked="1" or checked="0" instead of
checked="checked"; I'm not sure though.
Also, I can't think of a reason why it wasn't setting self['value'] if
self.getData() was not true.
Donovan
On Friday, October 4, 2002, at 09:52 AM, Paul Boehm wrote:
> CheckBox can now be checked by truth in the model
>
> and: is there a reason not to set self['value'] if
> self.getData() returns a value that isn't true?
>
> diff -u -r1.20 widgets.py
> --- widgets.py 3 Oct 2002 15:46:26 -0000 1.20
> +++ widgets.py 4 Oct 2002 16:52:50 -0000
> @@ -388,13 +388,17 @@
>
> def generateDOM(self, request, node):
> mVal = self.getData()
> - if mVal:
> - self['value'] = str(mVal)
> + self['value'] = str(mVal)
> return Widget.generateDOM(self, request, node)
>
> class CheckBox(Input):
> def initialize(self):
> self['type'] = 'checkbox'
> + def generateDOM(self, request, node):
> + node = Input.generateDOM(self, request, node)
> + if self.getData():
> + node.setAttribute('checked', "checked")
> + return node
>
> class RadioButton(Input):
> def initialize(self):
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
More information about the Twisted-Python
mailing list