Thursday, May 14, 2015

Re: GWT2.8 JsInterop Java->JS

Hi,
you are converting obj to a string before calling printObj:  "We can't see the obj's properties, only:" + obj 

Hope this helps.
   Alberto. 


On Fri, May 15, 2015 at 7:52 AM Alex W <alexwhite3000@gmail.com> wrote:
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.

--
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