> I have a problem with FunFormKit 0.4.1. If I check some values in a
> `MultiCheckboxField` display and the form is redisplayed after a
> failed validation, the check marks are removed in the redisplayed
> form. For comparison, `TextField`s and `RadioField`s work fine.
I've found the bug and submitted a patch suggestion to Sourceforge.
> Another problem I found in code for some fields; in several places the
> format `"%s_%2i" % (name, id)` is used for ids. However, for ids lower
> than 10 this results in names like "name_ 3" (note the space) which
> may cause trouble with some browsers.
Also there (and some other things :-) ).
As I looked at the FunFormKit source code, I thought that it would
simplify the code somewhat if
- the first items in selections (for radio buttons and checkboxes)
would be converted to strings as early in the processing as
possible. So there's less need for code like
if type(x) == types.StringType: ... else: ...
In fact, such code was missing from MultiCheckboxMixin and that was
the bug that bit me.
- for multi-checkboxes, passed-in variables were always converted to a
list, perhaps with only one element. This makes code simpler because
you don't have to write
if type(x) == types.ListType: ... else: ...
to differentiate between lists and strings.
What do you think?