Overlay Instantiation from within JavaScript

32 views
Skip to first unread message

WebDude

unread,
May 29, 2012, 3:46:32 PM5/29/12
to google-we...@googlegroups.com
I have a simple JavaScript overlay class.
How do I instantiate an instance of this class from within JavaScript (JSNI)?

Thomas Broyer

unread,
May 29, 2012, 4:15:58 PM5/29/12
to google-we...@googlegroups.com


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.

WebDude

unread,
May 29, 2012, 4:28:34 PM5/29/12
to google-we...@googlegroups.com
Ah, got it.  Thanks! 
Reply all
Reply to author
Forward
0 new messages