From f684807cdbd30576744a5b5ab429ab6011cc08d0 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Wed, 30 Jan 2013 15:40:43 +0200 Subject: Remove unnecessary special ConnectorMap handling from VTabsheet (#10839) VTabsheet manipulated ConnectorMap directly when detaching a removed child; this broke the hierarchy if the detached child was re-attached to another component later on. Change-Id: I18487c37b363d3fcd3984c789c7b73ed1bed5e28 --- .../tabsheet/MoveComponentBetweenTabsheets.html | 62 +++++++++++++++++++ .../tabsheet/MoveComponentBetweenTabsheets.java | 69 ++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/components/tabsheet/MoveComponentBetweenTabsheets.html create mode 100644 uitest/src/com/vaadin/tests/components/tabsheet/MoveComponentBetweenTabsheets.java (limited to 'uitest') diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/MoveComponentBetweenTabsheets.html b/uitest/src/com/vaadin/tests/components/tabsheet/MoveComponentBetweenTabsheets.html new file mode 100644 index 0000000000..a23729b282 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/tabsheet/MoveComponentBetweenTabsheets.html @@ -0,0 +1,62 @@ + + + + + + +MoveComponentBetweenTabsheets + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MoveComponentBetweenTabsheets
open/run/MoveComponentBetweenTabsheets?restartApplication
clickvaadin=runMoveComponentBetweenTabsheets::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]
assertTextvaadin=runMoveComponentBetweenTabsheets::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VHorizontalLayout[0]/Slot[1]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]/domChild[0]/domChild[0]L1
assertTextvaadin=runMoveComponentBetweenTabsheets::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VHorizontalLayout[0]/Slot[1]/VTabsheet[0]/VTabsheetPanel[0]/VLabel[0]Left 1
mouseClickvaadin=runMoveComponentBetweenTabsheets::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VHorizontalLayout[0]/Slot[1]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]7,11
assertTextvaadin=runMoveComponentBetweenTabsheets::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VHorizontalLayout[0]/Slot[1]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]R2
assertTextvaadin=runMoveComponentBetweenTabsheets::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VHorizontalLayout[0]/Slot[1]/VTabsheet[0]/VTabsheetPanel[0]/VLabel[0]Right 2
assertTextvaadin=runMoveComponentBetweenTabsheets::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VHorizontalLayout[0]/Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]L2
assertTextvaadin=runMoveComponentBetweenTabsheets::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VHorizontalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VLabel[0]Left 2
+ + diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/MoveComponentBetweenTabsheets.java b/uitest/src/com/vaadin/tests/components/tabsheet/MoveComponentBetweenTabsheets.java new file mode 100644 index 0000000000..3323d6a8d7 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/tabsheet/MoveComponentBetweenTabsheets.java @@ -0,0 +1,69 @@ +package com.vaadin.tests.components.tabsheet; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.TabSheet; + +/** + * Main UI class + */ +@SuppressWarnings("serial") +public class MoveComponentBetweenTabsheets extends AbstractTestUI { + + TabSheet left, right; + private Label l1; + private Label l2; + private Label r1; + private Label r2; + + void doTestOperation() { + right.addTab(l1, "L1"); + right.setSelectedTab(l1); + } + + @Override + protected void setup(VaadinRequest request) { + + // TODO Auto-generated method stub + Button button = new Button("Move L1 to the right tabsheet"); + button.addClickListener(new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + doTestOperation(); + } + }); + + getLayout().addComponent(button); + + left = new TabSheet(); + l1 = new Label("Left 1"); + left.addTab(l1, "L1"); + l2 = new Label("Left 2"); + left.addTab(l2, "L2"); + left.setWidth("400px"); + + right = new TabSheet(); + r1 = new Label("Right 1"); + right.addTab(r1, "R1"); + r2 = new Label("Right 2"); + right.addTab(r2, "R2"); + right.setWidth("400px"); + + getLayout().addComponent(new HorizontalLayout(left, right)); + } + + @Override + protected String getTestDescription() { + return "Moving a component from a tabsheet to another sometimes causes a client-side error"; + } + + @Override + protected Integer getTicketNumber() { + return 10839; + } + +} -- cgit v1.2.3