Hi,
> I am struggling with return types in methods implementing native
> javascript interfaces. Returning strings is no problem, but calling a
> method that returns a map
>
> public native Map<Long, GwtStock> getMap() /*-{
> return $wnd.parent.__getMap();
> }-*/;
>
> works only in hosted mode (!) and either throws a classcast exception
> or returns null.
>
I don't know how to return a Map directly but you could try to return
a JavaScriptObject
see
http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/core/client/JavaScriptObject.html
see
http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=DevGuideMarshaling
or what about:
JavaScript Overlay Types
Suppose you're happily using JSNI to call bits of handwritten
JavaScript from within your GWT module. It works well, but JSNI only
works at the level of individual methods. Some integration scenarios
require you to more deeply intertwine JavaScript and Java objects --
DOM and JSON programming are two good examples -- and so what we
really want is a way to interact directly with JavaScript objects from
our Java source code. In other words, we want JavaScript objects that
look like Java objects when we're coding.
GWT 1.5 introduces JavaScript overlay types to make it easy to
integrate entire families of JavaScript objects into your GWT project.
see
http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=DevGuideOverlayTypes
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---