Monday, July 9, 2007

checkbox value in Twill

in the twill, the value of the de-selected box of the item is [], while the value of selected box is ['1']

33 p23 checkbox p23 [] of ['1']
34 p22 checkbox p22 ['1'] of ['1']

the proper way to deselect the default checkbox, for instacne p22, is to
fv("3", "p22", "false").

if we use fv("3", "p22", "") to perform unselected checkbox, you may get the following error message:

File "c:\python25\lib\site-packages\twill-0.9b1-py2.5.egg\twill\utils.py", line 164, in make_boolean
raise Exception("unable to convert '%s' into true/false..." % (value,))
Exception: unable to convert '' into true/false...


You will know that you should use true or false to do select or deselect on the checkbox in twill.

1 comment:

buachaill ag gaire said...

s sense but what of the following situation. What is the proper way to select/deselect the following:

9 serviceIds checkbox service_1 [] of ['1', '2', '3', '4']