* 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();
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
Application application) throws JSONException {
if (null == value) {
- return combineTypeAndValue(JsonEncoder.VTYPE_NULL, JSONObject.NULL);
+ return encodeNull();
}
if (valueType == null) {
}
} 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) {
}
}
+ 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();