Javascript to Java call from Embedded

It is not clear where that line is defined. The syntax is only valid inside JSNI methods (i.e. native methods in GWT code) and not in e.g. external javascript files. If you want external javascript to be able to call into GWT code, you’d need to “export” that function as a JavaScript function. See
http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html#calling
for a simple example of how to do this.

In your case, I would however suggest completely leaving out the GWT part. It seems that what you are trying to do could be achieved using only JavaScript and server-side Java, either with
JavaScript.addFunction
or as a
JavaScript Component
.