From 0c229ae91460fedaeb557bdc5a646433658b0dfb Mon Sep 17 00:00:00 2001 From: Fabian Lange Date: Fri, 20 Jun 2014 10:49:50 +0200 Subject: Reading properties of components should not set state to dirty (#14060). Many core vaadin components did incorrectly mark the state as dirty when reading from them. This patch fixes the problem, which should reduce the amount of server->client state updates significantly. Change-Id: I342d74129e2985a7f407e9b53a802dc0146d9992 --- server/src/com/vaadin/ui/Button.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'server/src/com/vaadin/ui/Button.java') diff --git a/server/src/com/vaadin/ui/Button.java b/server/src/com/vaadin/ui/Button.java index 5a5d03a3ee..58b6f9de81 100644 --- a/server/src/com/vaadin/ui/Button.java +++ b/server/src/com/vaadin/ui/Button.java @@ -556,7 +556,7 @@ public class Button extends AbstractComponent implements * @return true if the button is disabled when clicked, false otherwise */ public boolean isDisableOnClick() { - return getState().disableOnClick; + return getState(false).disableOnClick; } /** @@ -582,7 +582,7 @@ public class Button extends AbstractComponent implements */ @Override public int getTabIndex() { - return getState().tabIndex; + return getState(false).tabIndex; } /* @@ -606,6 +606,11 @@ public class Button extends AbstractComponent implements return (ButtonState) super.getState(); } + @Override + protected ButtonState getState(boolean markAsDirty) { + return (ButtonState) super.getState(markAsDirty); + } + /** * Sets the component's icon and alt text. * @@ -628,7 +633,7 @@ public class Button extends AbstractComponent implements * @return String with the alt text */ public String getIconAlternateText() { - return getState().iconAltText; + return getState(false).iconAltText; } public void setIconAlternateText(String iconAltText) { @@ -658,7 +663,7 @@ public class Button extends AbstractComponent implements * false otherwise */ public boolean isHtmlContentAllowed() { - return getState().htmlContentAllowed; + return getState(false).htmlContentAllowed; } } -- cgit v1.2.3