在以编程方式创建上传时,所有上传示例都使用 NativeButton。我想使用作为设计器布局一部分的按钮(vaadin 按钮)。当我尝试这个时,我看到以下错误:
Caused by: java.lang.IllegalArgumentException: Trying to detach an element from parent that does not have it.
at com.vaadin.flow.dom.impl.AbstractNodeStateProvider.removeChild(AbstractNodeStateProvider.java:123)
at com.vaadin.flow.dom.Node.removeChild(Node.java:376)
at com.vaadin.flow.dom.Element.removeFromParent(Element.java:577)
at com.vaadin.flow.dom.Node.insertChild(Node.java:293)
at com.vaadin.flow.dom.Node.appendChild(Node.java:141)
at com.vaadin.flow.component.upload.GeneratedVaadinUpload.addToAddButton(GeneratedVaadinUpload.java:1344)
at com.vaadin.flow.component.upload.Upload.setUploadButton(Upload.java:276)
我们在 CDI 模式下使用 Vaadin 14。