On Oct 27, 7:18 am, mat <[EMAIL PROTECTED]> wrote:
> If I put my code inside a JNSI method, what is the point of having
> Overlay Types?
You misunderstand. That is the essence of the overlay type concept.
JavaScriptObject does not replace the need to write JSNI, it provides
a way to generate optimal code when dealing with real javascript
objects, instead of generating wrapper classes. The only way to access
true javascript methods or properties is to write JSNI stubs:
A trivial example... if you have this:
var obj = {'someValue': "foo"};
Then you could use this overlay type to access it:
public final FooObject extends JavaScriptObject {
public native String getSomeValue()/*-{
return this.someValue;
}-*/;
}
In your JSNI you can do anything you'd normally write in JavaScript.
There some things to know about allowable parameter and return types,
but essentially, that's the way it's done.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---