diff options
-rw-r--r-- | server/src/com/vaadin/ui/AbstractComponent.java | 3 | ||||
-rw-r--r-- | server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestWriteDesign.java | 15 |
2 files changed, 17 insertions, 1 deletions
diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index 5b7492dbdb..8517c216e3 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -1225,7 +1225,8 @@ public abstract class AbstractComponent extends AbstractClientConnector } // handle immediate if (explicitImmediateValue != null) { - design.attr("immediate", explicitImmediateValue.toString()); + DesignAttributeHandler.writeAttribute("immediate", attr, + explicitImmediateValue, def.isImmediate(), Boolean.class); } // handle locale if (getLocale() != null diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestWriteDesign.java b/server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestWriteDesign.java index 44c0e0b063..7f207a25ae 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestWriteDesign.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestWriteDesign.java @@ -34,6 +34,7 @@ import com.vaadin.server.UserError; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Button; import com.vaadin.ui.HorizontalSplitPanel; +import com.vaadin.ui.TabSheet; import com.vaadin.ui.declarative.DesignContext; /** @@ -137,6 +138,20 @@ public class TestWriteDesign extends TestCase { assertEquals("true", design.attr("immediate")); } + public void testSynchronizeImmediateByDefault() { + Element design = createDesign(); + TabSheet byDefaultImmediate = new TabSheet(); + // no immediate attribute should be written before setting immediate to + // false + byDefaultImmediate.writeDesign(design, ctx); + assertFalse(design.hasAttr("immediate")); + byDefaultImmediate.setImmediate(false); + byDefaultImmediate.writeDesign(design, ctx); + // we only changed one of the attributes, others are at default values + assertEquals(1, design.attributes().size()); + assertEquals("false", design.attr("immediate")); + } + public void testSynchronizeDescription() { Element design = createDesign(); AbstractComponent component = getComponent(); |