简体   繁体   中英

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!

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..)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM