[html-formfu] checkbox strangeness

Carl Franks fireartist at gmail.com
Wed Sep 17 15:21:12 BST 2008


2008/9/13 Geoffrey D. Bennett <g at netcraft.com.au>:
> On Mon, Aug 25, 2008 at 09:35:18AM +0100, Carl Franks wrote:
> [...]
>> > All this seems a bit excessive for what I would have thought would be
>> > a reasonably common case?
>> >
>> > I've now got:
>> >
>> > default_args:
>> >  elements:
>> >    Checkbox:
>> >      value: 1
>> >      default_empty_value: 1
>> >      inflator: Checkbox
>> >
>> > But don't those seem like reasonable defaults anyway?

Okay, the Checkbox element's value() now defaults to "1".
(and also the Radio element, which inherits from Checkbox)

I think it's likely anyone's been using it without setting the
value(), so it shouldn't have any negative effects.

I've also updated Model/DBIC, so if the checkbox is unchecked, and the
column is NOT NULL - it now gets set to 0 (zero), rather than the
DEFAULT VALUE.

Can you check the tests in trunk/HTML-FormFu-Model-DBIC/t/x_roundtrip/
[1] and verify that they do what you want?
Specifically, the config now doesn't require either value() or
default_empty_value() set.

[1] http://code.google.com/p/html-formfu/source/browse/#svn/trunk/HTML-FormFu-Model-DBIC/t/x_roundtrip

Cheers,
Carl



More information about the HTML-FormFu mailing list