diff options
author | Artur <Artur@Storm> | 2012-04-17 22:23:38 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-04-18 23:08:58 +0300 |
commit | 34d262dc610d066f1074a96c45d2ab2b9609ab14 (patch) | |
tree | 20da2b7bf98fe0496fdd44f84c5fe0cfe1e68c59 | |
parent | 52ef7a985e2f96d0f6ea55ea7e14deae96e57e4d (diff) | |
download | vaadin-framework-34d262dc610d066f1074a96c45d2ab2b9609ab14.tar.gz vaadin-framework-34d262dc610d066f1074a96c45d2ab2b9609ab14.zip |
Only paint connector references for visible connectors (#8685)
-rw-r--r-- | src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java | 2 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/server/JsonCodec.java | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index ec06c28780..87d147d55b 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -1168,7 +1168,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * The child to check * @return true if the child is visible to the client, false otherwise */ - private boolean isVisible(Component child) { + static boolean isVisible(Component child) { HasComponents parent = child.getParent(); if (parent == null || !child.isVisible()) { return child.isVisible(); diff --git a/src/com/vaadin/terminal/gwt/server/JsonCodec.java b/src/com/vaadin/terminal/gwt/server/JsonCodec.java index 1824a16fb2..8da8fdc933 100644 --- a/src/com/vaadin/terminal/gwt/server/JsonCodec.java +++ b/src/com/vaadin/terminal/gwt/server/JsonCodec.java @@ -25,6 +25,7 @@ import com.vaadin.external.json.JSONException; import com.vaadin.external.json.JSONObject; import com.vaadin.terminal.gwt.client.Connector; import com.vaadin.terminal.gwt.client.communication.JsonEncoder; +import com.vaadin.ui.Component; /** * Decoder for converting RPC parameters and other values from JSON in transfer @@ -205,7 +206,7 @@ public class JsonCodec implements Serializable { Application application) throws JSONException { if (null == value) { - return combineTypeAndValue(JsonEncoder.VTYPE_NULL, JSONObject.NULL); + return encodeNull(); } if (valueType == null) { @@ -252,6 +253,11 @@ public class JsonCodec implements Serializable { } } else if (value instanceof Connector) { Connector connector = (Connector) value; + if (value instanceof Component + && !(AbstractCommunicationManager + .isVisible((Component) value))) { + return encodeNull(); + } return combineTypeAndValue(JsonEncoder.VTYPE_CONNECTOR, connector.getConnectorId()); } else if (transportType != null) { @@ -264,6 +270,10 @@ public class JsonCodec implements Serializable { } } + private static JSONArray encodeNull() { + return combineTypeAndValue(JsonEncoder.VTYPE_NULL, JSONObject.NULL); + } + private static Object encodeObject(Object value, Application application) throws JSONException { JSONObject jsonMap = new JSONObject(); |