2

Flex application executes remote ColdFusion metod through RemoteObject. The remote method argument is VO. One of the numeric fields of VO is NaN. How to recognize NaN on CF side?

I've tried following:

this returns "true":

isDefined("vo.numeric_field_NaN")
isNumeric(vo.numeric_field_NaN)

this returns "false":

isNull(vo.numeric_field_NaN)

so, I've used following expression which returns "true" wher vo.numeric_field_NaN is NaN:

((vo.numeric_field_NaN GT 0) AND (vo.numeric_field_NaN LT 0))

Please advice if there is a way to determine NaN more patently.

PS:

I've tried to write this value to file but there was written "?" and I didn't succeed to find encoding to show the symbol correctly. I've tried and sniffer shows request to "%FD".

Oleg Vit'ko
  • 81
  • 1
  • 5
  • What does vo.numeric_field_Nan return when the flash variable is a number and what does it return when the flash variable is not? – Dan Bracuk Jan 30 '13 at 15:11
  • 1
    `if (vo.numeric_field_NaN EQ "NaN")` ? – duncan Jan 30 '13 at 15:26
  • What happens if you dump vo.numeric_field_NaN? Does it display NaN or some other value? I'm pretty sure I've used the isNumeric function in this situation before. Which version of ColdFusion are you using? ( Based on some Googling the problem you see is in CF7; but fixed in CF8 onward) – JeffryHouser Jan 30 '13 at 17:34
  • duncan, it doesn't work. please see that isNumeric(vo.numeric_field_NaN) returns "true" – Oleg Vit'ko Jan 31 '13 at 11:04
  • @www.Flextras.com, I can't dump it as the method should be launched remotelly to pass NaN through AMF. I'm using ColdFusion9. Thanks – Oleg Vit'ko Jan 31 '13 at 11:13
  • if isNumeric(vo.numeric_field_NaN) is returning true, that means that vo.numeric_field_NaN might actually be a number. Somehow you need to find a way to look at the value being passed. You could always mail yourself a dump of the vo scope. – Dan Bracuk Jan 31 '13 at 15:05
  • @Олег Витько If you can't dump it to the outgoing stream due to AMf; then dump it into an email and email it to yourself. Or build a test that does not go through the AMF Gateway. As Dan said. – JeffryHouser Jan 31 '13 at 15:39

1 Answers1

0

Wrap the variable with val() when you pass it to the setter. Any string value will be converted to a zero.

Adrian J. Moreno
  • 14,350
  • 1
  • 37
  • 44
  • It sounds like the poster is dealing with automatic conversion of an ActionScript object to a CFC via the AMF gateway. When do you think the user should use the val function? – JeffryHouser Jan 30 '13 at 17:19