Vaadin22 不返回表达式的值
当我调用 UI.getCurrent().getPage().executeJs("document.getElementById("test").scrollTop")
PendingJavaScriptResult
始终返回 null。错误处理程序不会给出任何错误。当我在浏览器的控制台中执行 javascript 时,一切正常。
我在这里做错了什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该将
"return document.getElementById("test").scrollTop"
作为 JavaScript 表达式。否则你什么也没有返回。You should have
"return document.getElementById("test").scrollTop"
as the JavaScript expression. Otherwise you're just returning nothing.