<script type="text/javascript">
function jsFunc() {
@xxxxxxxxxxxxxxxxxx.JSNIExample::staticFoo(Ljava/lang/String;)
("as"); }
</script>
на этом месте все и валится
Ошибка: reference to undefined XML name @com
Источник: http://127.0.0.1:2491/
Строка: 13
код класса:
public class JSNIExample {
String myInstanceField;
static int myStaticField;
void instanceFoo(String s) {
}
static void staticFoo(String s) {
RootPanel.get().add(new HTML(s));
}
}
Смотрел примеры:
http://googlewebtoolkit.blogspot.com/2008/07/getting-to-really-know-gwt-part-1-jsni.html
и на http://code.google.com/
что делаю не так?
например так:
You can even create JavaScript-callable libraries from your GWT code.
This is a pretty neat trick:
package org.example.yourcode.format.client;
public class DateFormatterLib implements EntryPoint {
// Expose the following method into JavaScript.
private static String formatAsCurrency(double x) {
return NumberFormat.getCurrencyFormat().format(x);
}
// Set up the JS-callable signature as a global JS function.
private native void publish() /*-{
$wnd.formatAsCurrency =
@org.example.yourcode.format.client.DateFormatterLib::formatAsCurrency(D);
}-*/;
// Auto-publish the method into JS when the GWT module loads.
public void onModuleLoad() {
publish();
}
}
> Смотрел примеры:http://googlewebtoolkit.blogspot.com/2008/07/getting-to-really-know-g...
> и наhttp://code.google.com/
>
> что делаю не так?