I bet you could write a type converter that would take care of this. In
fact, that might be something the devs need to put on the slate for the next
version. As Mike said, this is reasonable and expected behavior. It works
just like every other Object. Note that Boolean is an Object where boolean
is a primative. Just like float, int, and double. If you look at the
default values for primatives vs Objects in Java Objects will always default
to null. Primatives default to some value (int = 0, boolean = false, etc).
Gregg
On Mon, Nov 17, 2008 at 2:13 PM, Mike McNally <[EMAIL PROTECTED]> wrote:
> That seems like reasonable behavior to me. The workings of checkbox inputs
> can be very annoying for some programming models, including simple CRUD
> interfaces. If a model object has a boolean property, it'd be nice for there
> to be a way to make sure that the server always gets an explicit value for
> the checkbox. In another UI framework that problem grew to annoy me so much
> that I added a tag that marries a checkbox to a hidden input field. The
> checkbox serves no other purpose than to drive client-side code to update
> the hidden field.
>
> In the case of a lower-case-"b" boolean property, the framework doesn't
> really have a way to tell you that no value was received for that input
> field; or, more correctly, it has no way to distinguish between an explicit
> "false" and a "nothing supplied" false.
>
>
>
> On Mon, Nov 17, 2008 at 1:58 PM, Nathan Maves <[EMAIL PROTECTED]>wrote:
>
>> So I am a bit confused on the use of a checkbox with a Boolean attribute.
>>
>> >From the taglib docs...
>>
>> "When the value attribute is omitted, as above, the checkbox defaults
>> to the simple behaviour of sending "true" to the server when checked
>> and nothing to the server when unchecked. For this reason it is best
>> to use boolean values, or Boolean values initialized to
>> Boolean.FALSE."
>>
>> In my action I have a custom domain object with a Boolean attribute
>> contained in it. When the chekbox is not selcted the value of the
>> field is set to Null. In the default constructor of my domain object
>> I initialized the Boolean field to Boolean.FALSE.
>>
>> Everything work fine if I use boolean instead of Boolean. What more
>> am I expected to "initialize" when using a Boolean or is this a bug?
>>
>> Nathan
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Stripes-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/stripes-users
>>
>
>
>
> --
> Turtle, turtle, on the ground,
> Pink and shiny, turn around.
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users