2
我想从客户端javascript调用服务器端函数。我不敢肯定我在做什么错在这里:AbstractJavaScriptComponent客户端到服务器函数调用
public class Test extends AbstractJavaScriptComponent {
public Test() {
addFunction("notifyServer", new JavaScriptFunction() {
@Override
public void call(JsonArray arguments) {
Notification.show("The client notified you!");
}
});
}
而且从JavaScript connector.js我这样称呼它
function test(){
this.notifyServer();
notifyServer();
}
上述这些作品都没有。每次我得到相同的堆栈跟踪
Uncaught TypeError: this.notifyServer is not a function