aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/components/tabsheet/PreventTabChange.java
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/tabsheet/PreventTabChange.java')
-rw-r--r--uitest/src/com/vaadin/tests/components/tabsheet/PreventTabChange.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/PreventTabChange.java b/uitest/src/com/vaadin/tests/components/tabsheet/PreventTabChange.java
index 434c73f778..fddb036728 100644
--- a/uitest/src/com/vaadin/tests/components/tabsheet/PreventTabChange.java
+++ b/uitest/src/com/vaadin/tests/components/tabsheet/PreventTabChange.java
@@ -31,7 +31,8 @@ public class PreventTabChange extends TestBase implements
@Override
protected void setup() {
tabSheet = new TabSheet();
- tabSheet.addListener(this);
+ tabSheet.setId("tabsheet");
+ tabSheet.addSelectedTabChangeListener(this);
tab1 = new Label("Tab 1 contents");
tab2 = new Label("Tab 2 contents");
tab3 = new Label("Tab 3 contents");
@@ -48,8 +49,8 @@ public class PreventTabChange extends TestBase implements
@Override
public void selectedTabChange(SelectedTabChangeEvent event) {
-
TabSheet tabsheet = event.getTabSheet();
+
if (lastTab == tab1) {
if (tabsheet.getSelectedTab() != tab2) {
tabsheet.setSelectedTab(lastTab);
@@ -63,6 +64,7 @@ public class PreventTabChange extends TestBase implements
tabsheet.setSelectedTab(lastTab);
}
}
+
lastTab = tabsheet.getSelectedTab();
}
}