diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-04-17 17:40:59 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-04-20 15:19:23 +0300 |
commit | 435d69624c30bfca82a6104003fc2b28bdfcf2ed (patch) | |
tree | a8ce3e44873c3f30377e2bfcbfbebf9408894455 /server | |
parent | f89265749c7a6c126f545f95a9eaeddfea4e13cc (diff) | |
download | vaadin-framework-435d69624c30bfca82a6104003fc2b28bdfcf2ed.tar.gz vaadin-framework-435d69624c30bfca82a6104003fc2b28bdfcf2ed.zip |
Fix using ConnectorResource icons before attaching ComboBox (#10810)
* Fix using ConnectorResource icons before attaching ComboBox
* Update Chrome and PhantomJS screenshots
Diffstat (limited to 'server')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/ComboBox.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/ui/ComboBox.java b/server/src/main/java/com/vaadin/ui/ComboBox.java index ef1e7cfa84..107e503256 100644 --- a/server/src/main/java/com/vaadin/ui/ComboBox.java +++ b/server/src/main/java/com/vaadin/ui/ComboBox.java @@ -842,6 +842,10 @@ public class ComboBox<T> extends AbstractSingleSelect<T> Resource icon = getItemIconGenerator().apply(value); if (icon != null) { if (icon instanceof ConnectorResource) { + if (!isAttached()) { + // Deferred resource generation. + return; + } setResource("selected", icon); } selectedItemIcon = ResourceReference @@ -852,6 +856,13 @@ public class ComboBox<T> extends AbstractSingleSelect<T> } @Override + public void attach() { + super.attach(); + + updateSelectedItemIcon(); + } + + @Override protected Element writeItem(Element design, T item, DesignContext context) { Element element = design.appendElement("option"); |