Right, I first followed the static export example and got things working.
 Then realized I actually wanted to use it non-statically and got help on
this forum with how to include the instance into the export (main.@...).

As I said, it would work sporadically, but not always.  An non-static
example would be very useful as I still don't completely understand why it
needed to be wrapped with an anonymous function.



On Wed, Mar 19, 2014 at 4:06 PM, Jens <jens.nehlme...@gmail.com> wrote:

> I don't know why this information isn't in the docs but it should be added
>> right away.
>>
>
> Indeed. I also always forget about that 'this' thing and I am pretty sure
> I would have written the same code as you did in the first post and would
> have lost some time again until remembering that
>
> public void log(String level, String msg) {
>   logger.debug(msg);
> }
>
> will try to access logger on $wnd.jsni when calling it from pure JS
> (following your example).
>
> I think we should add a non-static method export example to
> http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html#callingand 
> explain why such an export looks different.
>
> -- J.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google Web Toolkit" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-web-toolkit/vDteixKON4g/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to