简体   繁体   English

在jsni函数中调用GWT java方法

[英]calling GWT java method in jsni function

I created a JSNI function when the page reach on the bottom it will call some method but i'm having a problem on calling it here is my code 我创建了一个JSNI函数,当页面到达底部它会调用一些方法,但我在调用它时遇到问题是我的代码

public static native void scroll() /*-{
    var that = this;
    $wnd.$($wnd).on("scroll", function($) {
        var scrollHeight = $wnd.$($doc).height();
        var scrollPosition = $wnd.$($wnd).height() + $wnd.$($wnd).scrollTop();
        if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
            $wnd.$('#loadmore').removeClass('uk-hidden');
            return that.@my.app.client.local.HomePage::query(*)(null);
        }
    });
}-*/;

When I try to call this JSNI I receive an error 当我尝试调用此JSNI时,我收到错误

Uncaught TypeError: that_0_g$.query_2_g$ is not a function 未捕获的TypeError:that_0_g $ .query_2_g $不是函数

你的方法是静态的,所以没有this

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM