summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2015-03-23 12:10:07 +0200
committerVaadin Code Review <review@vaadin.com>2015-03-24 09:04:25 +0000
commit2a671f2810dfb409cc4d30a1606868282d0925d3 (patch)
treeddc54f63c6dcbf82ced308659ed5a2b10869ebfe /client
parent4f3397df74dc737a9c5592d5418e741433e20dee (diff)
downloadvaadin-framework-2a671f2810dfb409cc4d30a1606868282d0925d3.tar.gz
vaadin-framework-2a671f2810dfb409cc4d30a1606868282d0925d3.zip
Fix declarative support for CustomLayout (#17210)
CustomLayout now has a public default constructor. If a template is not set using one of the setters, a warning message is displayed like in the case where the template file is specified but not found. Change-Id: I5d56f24fafc5c82e6ab76dec393a0c25bd78aae5
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/client/src/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java b/client/src/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java
index 80979587b9..cde1f1af0f 100644
--- a/client/src/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java
+++ b/client/src/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java
@@ -77,22 +77,24 @@ public class CustomLayoutConnector extends AbstractLayoutConnector implements
// (even though both can never be given at the same time)
templateContents = getConnection().getResource(
"layouts/" + templateName + ".html");
- if (templateContents == null) {
- // Template missing -> show debug notice and render components
- // in order.
- getWidget()
- .getElement()
- .setInnerHTML(
- "<em>Layout file layouts/"
- + templateName
- + ".html is missing. Components will be drawn for debug purposes.</em>");
- }
}
if (templateContents != null) {
// Template ok -> initialize.
getWidget().initializeHTML(templateContents,
getConnection().getThemeUri());
+ } else {
+ // Template missing -> show debug notice and render components in
+ // order.
+ String warning = templateName != null ? "Layout file layouts/"
+ + templateName + ".html is missing."
+ : "Layout file not specified.";
+ getWidget()
+ .getElement()
+ .setInnerHTML(
+ "<em>"
+ + warning
+ + " Components will be drawn for debug purposes.</em>");
}
templateUpdated = true;
}