From ad290f8c65057bdef33ec73cb49a8c6d10b9e356 Mon Sep 17 00:00:00 2001 From: michaelvogt Date: Wed, 3 Apr 2013 14:12:42 +0300 Subject: Fix for CheckBox and Layout (#11407) Change in CheckBoxConnector led to wrong enabled behaviour and addition to top coordinate to prevent scrollbars with VPopupCalendar Change-Id: I381ab7c8a605535280ae58716181ef4c346997f7 --- .../tests/layouts/CaptionsInLayoutsWaiAria.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'uitest') diff --git a/uitest/src/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java b/uitest/src/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java index 4ffe7f806e..ec323f2db2 100644 --- a/uitest/src/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java +++ b/uitest/src/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java @@ -55,6 +55,7 @@ public class CaptionsInLayoutsWaiAria extends TestBase { addComponent(toggleIcon()); addComponent(toggleReadOnly()); addComponent(toggleInvalid()); + addComponent(toggleEnabled()); addComponent(addCaptionText()); // layoutParent.addComponent(new // NativeButton("Button right of layout")); @@ -125,6 +126,21 @@ public class CaptionsInLayoutsWaiAria extends TestBase { return readOnlyToggle; } + private Component toggleEnabled() { + CheckBox enabledToggle = new CheckBox(); + enabledToggle.setImmediate(true); + enabledToggle.setValue(true); + enabledToggle.setCaption("Enabled"); + enabledToggle.addValueChangeListener(new ValueChangeListener() { + @Override + public void valueChange(ValueChangeEvent event) { + setEnabled((Boolean) event.getProperty().getValue()); + } + }); + + return enabledToggle; + } + private Component toggleInvalid() { CheckBox invalid = new CheckBox("Invalid"); invalid.setImmediate(true); @@ -174,6 +190,12 @@ public class CaptionsInLayoutsWaiAria extends TestBase { } } + protected void setEnabled(boolean value) { + for (AbstractField c : components) { + c.setEnabled(value); + } + } + private Component toggleError() { CheckBox errorToggle = new CheckBox(); errorToggle.setImmediate(true); -- cgit v1.2.3