On Tue, Oct 16, 2012 at 8:42 AM, erik <m8r-y3l...@chammy.info> wrote:

> Thank you for your thoughts, Manuel!
>
> I've tested this some more yesterday and found out that using gwt-exporter
> isn't enough. The compiler will still prune any methods and class that
> doesn't seem to be used even if it was exported to JS.
> The real problem here is that the compiler has strict rules about where
> "original" java objects can be obtained.
> If the only way to get a reference to a java object of type X is an
> external call from JS (or another gwt module via jsni), the compiler will
> always remove this type and all it's methods. The JSNI documentation 
> here<https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsJSNI#passing-javascript>is
>  the key for me: "Java
> Object of the correct type that must have originated in Java code" ...
>

I think you have something wrong in your tests, if you annotate a class
with @Export and it  implements Exportable, when you call GWT.create(...),
or ExporterUtil.esportAll(), that class and all its methods will be
available in the js outuput because gwt-exporter references those methods
in the generated wrapper class.



>
> Following this description I've added an exported dummy method which
> returns a static object of type X. That way it's possible to have a
> reference to a java object in javascript and pass it back to java. However,
> I don't actually use this method. Instead I use a jsni call from my second
> gwt module which transfers a different object of the same type to my
> receiver module. Et voilà, it works!
>
>
> Erik
>
> --
> 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/-/qWOp3_Gm88oJ.
>
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>

-- 
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 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to