When i call UI.getCurrent().getPage().executeJs("document.getElementById("test").scrollTop")
the PendingJavaScriptResult always returns null. No error is given through the error handler. When i execute the javascript in the console of the browser everything works fine.
What am i doing wrong here?
You should have "return document.getElementById("test").scrollTop" as the JavaScript expression. Otherwise you're just returning nothing.