Jivago
Jivago

Reputation: 826

Null integers in Flex

My database field is as is : num_in_stock, mediumint(8), NULL (yes)

I'm generating my services using the Connect to Data/Service tool in Flash Builder 4

What is the best course of action if I want my num_in_stock field to have a value of NULL, not zero (0) when we leave the field empty?

Thanks!

Upvotes: 0

Views: 1031

Answers (1)

J_A_X
J_A_X

Reputation: 12847

In Flash, you can't have an int as null. int and uint default to 0. Number however defaults to NaN. You could always convert your int to Number before it's sent over to Flash and make sure it's NaN. However, this would depend on your data transportation protocol (amf, json, etc..)

Upvotes: 1

Related Questions