Closed GoogleCodeExporter closed 9 years ago
Tested with SmartGWT 3.1 (v8.3p_2012-11-23) as well as some older nightly build
(v8.3p_2012-11-30).
Original comment by joerg.ho...@googlemail.com
on 6 Feb 2013 at 2:36
By default, this value is internally stored as a JavaScript Number, and
JavaScript lacks the range to store integral values this large.
We recommend using a String instead to represent a value like this, which we
assume is really a unique ID rather than a numeric value you plan to do math
with.
It's also possible to use SimpleType with a ValueExtractor/ValueUpdater to have
a Record store a value that is internally represented as a Java Long. But
there is little point in doing this if the value is just an ID - String works
better for that.
We may eventually add a SimpleType as described above as a framework feature,
but we don't plan to have the framework switch over to this strategy by default
as it is much slower. This means that the code above will still be expected to
round off Long values, and you would you would have to declare a
DataSourceField with a special type in order to switch over to the slower
storage strategy that allows the full range of Java Long.
Original comment by smartgwt...@gmail.com
on 6 Feb 2013 at 3:56
Thanks for clarification.
> We may eventually add a SimpleType as described above as a framework feature,
> but we don't plan to have the framework switch over to this strategy by
> default as it is much slower.
I do understand this, but it should be documented explicitly. Maybe even an
assert should be considered to warn developers if they are (mis)using record
fields for to large values.
As a "regular" GWT developer you do not expect this as GWT supports this and
documents it:
https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsCompati
bility
Original comment by joerg.ho...@googlemail.com
on 18 Feb 2013 at 9:23
Original issue reported on code.google.com by
joerg.ho...@googlemail.com
on 6 Feb 2013 at 2:21