Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

calling GWT java method in jsni function

Tags:

java

gwt

jsni

errai

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

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 [email protected]::query(*)(null);
        }
    });
}-*/;

When I try to call this JSNI I receive an error

Uncaught TypeError: that_0_g$.query_2_g$ is not a function

like image 384
julsbrhm Avatar asked Feb 02 '26 18:02

julsbrhm


1 Answers

Your method is static so there's no this!

like image 165
Thomas Broyer Avatar answered Feb 04 '26 09:02

Thomas Broyer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!