如何在 Vaadin 14 中显示静态组件?每次我更新页面时,我都会收到错误消息。
在这种情况下,startStopYOLO, cameras, darknet, configuration, weights, thresholds, realTimeCameraImage, layout
都是static
// Content
if(layout == null) {
layout = new VerticalLayout();
layout.add(new FormLayout(startStopYOLO, cameras, darknet, configuration, weights, thresholds));
layout.add(realTimeCameraImage);
layout.setAlignItems(Alignment.CENTER);
}
setContent(layout); // Here I get the error:
错误是:
Can't move a node from one state tree to another. If this is intentional, first remove the node from its current state tree by calling removeFromTree
所以我需要清理第content
一个。我怎样才能在 Vaadin 14 中做到这一点?