Thursday, May 14, 2015

GWT2.8 JsInterop Java->JS

We are usingJSInterop in GWT2.8. In one of our RPCs we have some code like this that passes our java object to JS:
onSuccess(List<MyObject> objs) { 
   for (MyObject obj: objs) {
     jsCode.printObj("We can't see the obj's properties, only:" + obj);
  }
}
The definition of jsCode looks like this:
ns.printObj = function(obj) {
   console.log(JSON.stringify(obj));
}
In the console we get back:
We can't see the obj's properties, only:our.ns.type.MyObject@16

The value object has been annotated as @JsType. Anything else we need to do?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment