If I want to make use of the nice binding functionality
provided by Flex. But I can't figure out a couple 'simple' little
- My object has a non-required property of type Number and I
want to bind it to a TextInput component. But when it is null (I
call it "null" because it comes from a Java server app where the
value is null, but in ActionScript, it's NaN), my TextInput field
shows the actual text "NaN". I know what NaN is, but it just want
just want the TextInput control to be blank to indicate null/NaN.
This is wired to a Java app on the server where number objects are
- Similar idea for a date property. When the DateInput
component is blank, I want it to set my date property on my object
to null. Instead it throws an exception saying that "" can't be
coerced to a date type.
I'm using BindingUtils.bindProperty, but I'm think I'm
missing some basic binding concepts here. Any pointers?
Ok, thanks for your quick reply. It was a late night last
night, today I'm a little more clear-headed :)
I guess I failed to mention that I have many
objects/properties like this, so your solution would work, but
would be a maintenance headache in my case. So I just copied the
BindUtils.bindProperty source and modified it to the following.
Seems to do the trick. Thanks again.