From 42af2df434d96a993e90a46e08bbaa883f5c3b3b Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 29 Jun 2009 14:33:33 +0000 Subject: Fix for #3059 - Window's setStyleName, removeStyleName does not remove old styles on the client side. svn changeset:8267/svn branch:6.0 --- src/com/vaadin/terminal/gwt/client/ui/VView.java | 3 ++- src/com/vaadin/tests/components/window/WindowStyleNames.java | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VView.java b/src/com/vaadin/terminal/gwt/client/ui/VView.java index d23dbb39de..00ed1e935c 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VView.java @@ -155,7 +155,8 @@ public class VView extends SimplePanel implements Container, theme = newTheme; } if (uidl.hasAttribute("style")) { - addStyleName(uidl.getStringAttribute("style")); + setStyleName(getStylePrimaryName() + " " + + uidl.getStringAttribute("style")); } if (uidl.hasAttribute("name")) { diff --git a/src/com/vaadin/tests/components/window/WindowStyleNames.java b/src/com/vaadin/tests/components/window/WindowStyleNames.java index f48b0a9c6e..3a36926b42 100644 --- a/src/com/vaadin/tests/components/window/WindowStyleNames.java +++ b/src/com/vaadin/tests/components/window/WindowStyleNames.java @@ -36,6 +36,14 @@ public class WindowStyleNames extends TestBase { })); + addComponent(new Button("Add 'foo' style", new ClickListener() { + + public void buttonClick(ClickEvent event) { + getMainWindow().addStyleName("foo"); + } + + })); + } protected void setWindowStyle(String string) { -- cgit v1.2.3