-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
Simple scenario: the xterm console is shown in an draggable container. That draggable container is moved to another position, which is internally just a remove from parent A and attach to parent B. This results in an "empty" tag on the client side (it looses basically its xterm instance as it seems).
Removing and adding in two request cycles works, also simply hiding and showing it using setVisible.
The following example shows the issue in a simplified manner:
public XTermView() {
XTerm xterm = new XTerm();
xterm.writeln("Hello world.\n\n");
xterm.setWidth("500px");
xterm.setHeight("250px");
VerticalLayout left = new VerticalLayout(xterm);
VerticalLayout right = new VerticalLayout();
add(new Button("Switch", event -> {
Component parent = xterm.getParent().orElse(null);
if (parent == left) {
right.add(xterm);
} else {
left.add(xterm);
}
}));
SplitLayout layout = new SplitLayout(left, right);
layout.setSplitterPosition(50);
layout.setOrientation(SplitLayout.Orientation.HORIZONTAL);
add(layout);
}
The resulting element looks like this after using the Switch button:
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Under consideration
