Although GWT obfuscates the produced javascript code renaming methods,
classes, etc, it is possible to use a GWT method from javascript if
you export it storing a reference in the window object:
private native void exportMyMethod() /*-{
$wnd.showAlert = function(name) {
return @c
Java functions are translated into obfuscated (ie renamed) javascript,
so will not be available to call from an element. You can create a
javascript function, perhaps attached to wnd, which could then call a
java function.
On Jun 2, 1:46 pm, DK wrote:
> I have an anchor element with an onClick="
I have an anchor element with an onClick="showAlert();"
in my java file, I have a JSNI function
public static native void showAlert() /*-{
alert('Hello');
}-*/;
I never see this alert. In fact, when I look at the browser console, I
see that showAlert could not be found. What