But when I try to de-serialize it in the javascript it fails (seem to work fine when done outside of browser)
I get this error in the browser js console:
finished loading: "http://127.0.0.1:8580/data".
Uncaught TypeError: Object netColarLogStats::LogDataTableModel.formatedKeys has no method 'of' :8580/pod/sys/sys.js:7840
LogDataTableModel.formatedKeys is a map [Str:Str] so not sure why it would say it does not have an of method ??
Any ideas ?
andyMon 28 Jun 2010
Facet support isn't complete in JavaScript - which is needed to fully implement serialization.
tcolarTue 29 Jun 2010
I'm not using facets, but I suppose that internally it needs Facet support.
That's too bad, I think serialization + Ajax would have been super cool.
Any ideas about when that could work- Is it a lot of work? or more a question of flushing the design ?
What would be my best alternative in the meantime ? passing data in XML format ? other ?
Thanks.
andyTue 29 Jun 2010
Yeah the internal APIs need to them to work properly. Deserialization should actually work tho - its the encoding side that needs a bit more work.
Facets are at the top of my list to implement in JavaScript - I will be needing them very soon in SkySpark, so I would imagine in the next few weeks it will be working.
In the meantime, you're probably best rolling our own simple string format. Fantom makes it pretty easy to parse string content, so I think that'd be the easiest thing.
tcolarTue 29 Jun 2010
I'm only doing de-serialization and it seem to be working except for that map. Will try to narrow the issue down a bit - don't think it has to do with facets.
andyTue 29 Jun 2010
Oh yeah, that's a bug. I pushed a fix - see if that works for you.
tcolarTue 29 Jun 2010
Thanks, was gonna report that just now :) tracked it down with chrome console. Will see if fix helps, but i notices it also will call this.readMap() and that method does not seem to exists in sys.js (unless it's in another js ??) .. anyway will try tip and see if that helps.
tcolarTue 29 Jun 2010
Actually there is a readMap in ObjDecoder, but it's called just readMap rather than fanx_ObjDecoder.prototype.readMap
It has an empty "TODO" comment ... so maybe it's juts not finished, though the code in it looks fine.
EDIT: never mind: I see now it's commented out - I guess not ready yet.
tcolarTue 29 Jun 2010
For now I just replaced the map by my own associative object with it's own simple string serialization , using @Serializable { simple = true }
tcolar Mon 28 Jun 2010
I'm trying to fetch some data serialized with
out.writeObj()
using an ajax call (that part works well), I get my data:But when I try to de-serialize it in the javascript it fails (seem to work fine when done outside of browser)
I get this error in the browser js console:
LogDataTableModel.formatedKeys
is a map[Str:Str]
so not sure why it would say it does not have anof
method ??Any ideas ?
andy Mon 28 Jun 2010
Facet support isn't complete in JavaScript - which is needed to fully implement serialization.
tcolar Tue 29 Jun 2010
I'm not using facets, but I suppose that internally it needs Facet support.
That's too bad, I think serialization + Ajax would have been super cool.
Any ideas about when that could work- Is it a lot of work? or more a question of flushing the design ?
What would be my best alternative in the meantime ? passing data in XML format ? other ?
Thanks.
andy Tue 29 Jun 2010
Yeah the internal APIs need to them to work properly. Deserialization should actually work tho - its the encoding side that needs a bit more work.
Facets are at the top of my list to implement in JavaScript - I will be needing them very soon in SkySpark, so I would imagine in the next few weeks it will be working.
In the meantime, you're probably best rolling our own simple string format. Fantom makes it pretty easy to parse string content, so I think that'd be the easiest thing.
tcolar Tue 29 Jun 2010
I'm only doing de-serialization and it seem to be working except for that map. Will try to narrow the issue down a bit - don't think it has to do with facets.
andy Tue 29 Jun 2010
Oh yeah, that's a bug. I pushed a fix - see if that works for you.
tcolar Tue 29 Jun 2010
Thanks, was gonna report that just now :) tracked it down with chrome console. Will see if fix helps, but i notices it also will call this.readMap() and that method does not seem to exists in sys.js (unless it's in another js ??) .. anyway will try tip and see if that helps.
tcolar Tue 29 Jun 2010
Actually there is a
readMap
in ObjDecoder, but it's called justreadMap
rather thanfanx_ObjDecoder.prototype.readMap
It has an empty "TODO" comment ... so maybe it's juts not finished, though the code in it looks fine.
EDIT: never mind: I see now it's commented out - I guess not ready yet.
tcolar Tue 29 Jun 2010
For now I just replaced the map by my own associative object with it's own simple string serialization , using
@Serializable { simple = true }
Works good.