Sunday, December 13, 2009

Re: External Javascript method call

On 11 déc, 07:31, JavaDoc <amey.m...@gmail.com> wrote:
> Hello,
>
> Ive associated a certain FooBar.js to my module.
> The javascript has a method Foo(), which I need to invoke.
>
> I am trying to do this through JSNI, however, its failing. Heres my
> code:
>
> public native void doSomething() /*-{
> var bar = new Foo();
> //some other stuff
>
> }-*/;
>
> This method is being called through an onClick event of a GWT button.
>
> I am however, getting this exception in my console:
>
> [ERROR] Uncaught exception escaped
> com.google.gwt.core.client.JavaScriptException: (TypeError): 'Foo' is
> undefined
>  number: -2146823279
>
> Please help me out!!!! :(

var bar = new $wnd.Foo();

See http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasics.html#DevGuideJavaScriptNativeInterface

--

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate