Friday, July 18, 2014

Can Object.observe() and GWT play together?

As Chrome 36 was just released and included built-in support for Object.observe(), I thought I'd test it out, but I got stuck when I wanted it to observe java-objects instead of plain javascript-objects. 

I would have a list of some domain objects in an instance variable, like:
    List<Contact> contacts; 
where Contact would have name and address objects and so on.  

I would then like to use something like:
   Object.observe(<something>, function(changes) { <call back to java code to notify object has changed> });  

That "something" should point to some contact's address object (for example)

The callback is working just fine when observing a plain javascript object, but I can't figure out how to get it working with my instance variable. 

Am I missing something simple here? 

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