1 Aug 2007 01:20
Re: [Flowscript] everything converted to "number" type?
Tobia Conforto <tobia.conforto <at> linux.it>
2007-07-31 23:20:31 GMT
2007-07-31 23:20:31 GMT
Mark Lundquist wrote: > I've got some CForms widgets of <datatype base="long"/>, so I expect > that the widget value should be a java.lang.Long, right? Widget's getValue() returns an Object, so that would make sense, yes. > it seems like every reference to the widget value gets converted to a > JS "number" type Probably because all Java number types (including their wrapping objects in java.lang) get converted to a JS Number, which sounds reasonable BTW. I suppose you could find notes on the type mapping between Java and JS on Rhino's website. Rhino is the Javascript interpreter used by Cocoon. Now, if it also converted java.lang.String to JS strings automatically, it would have spared me many a headache... unfortunately that's a conversion that Rhino seems reluctant to do. > and truncated to an integer value. I believe that a Java long is an integer type. Tobia
Aren't you mixing up 'long' with 'double'? I think you need <datatype
base="double"/> or <datatype base="decimal"/> for a value like 3.5...
See [1] for more info.
Regards
Niels
[1]
RSS Feed