【问题标题】:Vaadin Flow UnsupportedOperationException: Confirmed duplicate message from the clientVaadin Flow UnsupportedOperationException:确认来自客户端的重复消息
【发布时间】:2019-11-03 21:20:11
【问题描述】:

我想使用带有 Button 的 Anchor 元素作为子元素,但在这种情况下我遇到了异常:

java.lang.UnsupportedOperationException:确认重复消息 从客户端。预期同步 id:2,得到 1。消息开始: {"csrfToken":"992caf41-4b1c-4b1e-97da-04c83c55301a","rpc":[{"type":"event","node":10,"event":"click","data":{ "event.shiftKey":false,"event.metaKey":false,"event.detail":1,"event.ctrlKey":false,"event.clientX":693,"event.clientY":166,"event .altKey":false,"event.button":0,"event.screenY":262,"event.screenX":693}}],"syncId":1,"clientId":1}

这是我的元素的源代码:

Button button = new Button("Rules");
Anchor anchor = new Anchor("/rules", button);

我的课程来源:https://pastebin.com/G8zU0csP

我正在使用 Vaadin 14.0.5 谁能帮我解决这个问题?

【问题讨论】:

    标签: java vaadin vaadin-flow vaadin10


    【解决方案1】:

    您是否将 buttonanchor 都添加到 UI 中?如果是这种情况,那么您应该只添加anchordirect。这似乎对我有用,没有任何问题

    Button button = new Button("Title");
    Anchor anchor = new Anchor("https://stackoverflow.com/questions/58684723/vaadin-flow-unsupportedoperationexception-confirmed-duplicate-message-from-the", button); add(anchor);
    

    您能否为您的示例添加更多详细信息? Anchor 中的 URL 是什么?

    【讨论】:

    • ``` 按钮按钮 = 新按钮(标题);锚定锚 = new Anchor("/rules", button); ```
    • 使用带有链接的锚点在应用程序内部导航会遇到问题
    • 当然,我只在 UI 中添加了 Anchor
    • 如果我只是导航到另一条路线,我仍然无法重现错误。你有最小可重现的例子吗?就像只有那两个有错误的视图?
    • 你的BaseView 中的anchor 元素是什么?你的configurePage 是什么样子的?如果我只是将anchor 重命名为使用logogAnchor 并留下configurePage 而不执行,那么一切正常。这让我觉得问题不在于您要询问的 sn-p 代码,而是您尚未共享的 anchor。如果我们无法重现问题,我们无能为力。对此感到抱歉
    猜你喜欢
    • 2015-06-04
    • 2016-02-09
    • 1970-01-01
    • 1970-01-01
    • 2015-12-19
    • 2019-05-16
    • 1970-01-01
    • 2013-02-22
    • 1970-01-01
    相关资源
    最近更新 更多