Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

getAttributeAsBoolean with null values

$
0
0
In SmartGWT 4.0, I'm trying to load a hibernate-backed entity into a ListGridRecord and then back to the entity.

The entity contains a few optional true/false values, represented as java.lang.Boolean objects with true/false for set values and null for no value provided.

Unfortunately, when I try to convert this into a record and back again (setAttribute/getAttributeAsBoolean), the null is being converted into a false.

It looks like this is happening in the JSOHelper class. Most of the getAttribute calls allow for a null by returning the null object, but JSOHelper.getAttributeAsBoolean is explicitly converting that null into false to return the primitive value instead of the wrapper class.

Is this intended behavior? If so, is there another way I should be accessing a Boolean value?

Viewing all articles
Browse latest Browse all 4756

Trending Articles