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