Tuesday, May 29, 2012

Re: Overlay Instantiation from within JavaScript

On Tuesday, May 29, 2012 1:15:58 PM UTC-7, Thomas Broyer wrote:


On Tuesday, May 29, 2012 9:46:32 PM UTC+2, WebDude wrote:
I have a simple JavaScript overlay class.
How do I instantiate an instance of this class from within JavaScript (JSNI)?

The whole point of overlays is that they're not real classes, they're not things that you instantiate (they "map" a JS object into the Java world), and they don't correspond to a JS "class".
So create whatever object in JS that has the properties and "methods" that the overlay "maps" to Java, and you're done.
An overlay class is only a Java "view" on JS objects, so you can manipulate it in Java as if it were a Java object.

Ah, got it.  Thanks! 

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/uYuCpPzo6B0J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment