aboutsummaryrefslogtreecommitdiffstats
path: root/client/src
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2015-04-29 14:30:55 +0300
committerTeemu Suo-Anttila <teemusa@vaadin.com>2015-05-04 07:05:40 +0000
commitdd05b436d9f74e9daa54829db3c73ff473d18acd (patch)
tree23971c5b21c1742ca6d976f0f1dcf43b34496cd9 /client/src
parent1fcd9a83b9760c82ba524016daf257b3cc706cab (diff)
downloadvaadin-framework-dd05b436d9f74e9daa54829db3c73ff473d18acd.tar.gz
vaadin-framework-dd05b436d9f74e9daa54829db3c73ff473d18acd.zip
Render CustomLayout properly even if a slot is missing (#17681)
Change-Id: I1ca0699776b93987c00a23a61a64ba8f3b4cd95e
Diffstat (limited to 'client/src')
-rw-r--r--client/src/com/vaadin/client/ui/VCustomLayout.java4
-rw-r--r--client/src/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java9
2 files changed, 13 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/ui/VCustomLayout.java b/client/src/com/vaadin/client/ui/VCustomLayout.java
index 5f8a8197d0..0ee50fe0dd 100644
--- a/client/src/com/vaadin/client/ui/VCustomLayout.java
+++ b/client/src/com/vaadin/client/ui/VCustomLayout.java
@@ -305,6 +305,10 @@ public class VCustomLayout extends ComplexPanel {
/** Update caption for given widget */
public void updateCaption(ComponentConnector paintable) {
Widget widget = paintable.getWidget();
+ if (widget.getParent() != this) {
+ // Widget has not been added because the location was not found
+ return;
+ }
VCaptionWrapper wrapper = childWidgetToCaptionWrapper.get(widget);
if (VCaption.isNeeded(paintable.getState())) {
if (wrapper == null) {
diff --git a/client/src/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java b/client/src/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java
index cde1f1af0f..abbb0ef60b 100644
--- a/client/src/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java
+++ b/client/src/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java
@@ -15,6 +15,8 @@
*/
package com.vaadin.client.ui.customlayout;
+import java.util.logging.Logger;
+
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.ApplicationConnection;
@@ -111,6 +113,9 @@ public class CustomLayoutConnector extends AbstractLayoutConnector implements
getWidget().setWidget(child.getWidget(), location);
} catch (final IllegalArgumentException e) {
// If no location is found, this component is not visible
+ getLogger().warning(
+ "Child not rendered as no slot with id '" + location
+ + "' has been defined");
}
}
for (ComponentConnector oldChild : event.getOldChildren()) {
@@ -147,4 +152,8 @@ public class CustomLayoutConnector extends AbstractLayoutConnector implements
// Not interested in anything from the UIDL - just implementing the
// interface to avoid some warning (#8688)
}
+
+ private static Logger getLogger() {
+ return Logger.getLogger(CustomLayoutConnector.class.getName());
+ }
}