diff --git a/demo-web-site/src/main/java/com/vaadin/hummingbird/demo/website/DynamicResourcesView.java b/demo-web-site/src/main/java/com/vaadin/hummingbird/demo/website/DynamicResourcesView.java index 398cfd9f7..860a7b2b1 100644 --- a/demo-web-site/src/main/java/com/vaadin/hummingbird/demo/website/DynamicResourcesView.java +++ b/demo-web-site/src/main/java/com/vaadin/hummingbird/demo/website/DynamicResourcesView.java @@ -61,7 +61,8 @@ private void createGenerateImageButton() { Button button = new Button("Generate image"); button.addClickListener(event -> { - image.setAttribute("data", createResource()); + // image.setAttribute("data", createResource()); + updateImage(); }); add(button); @@ -83,14 +84,24 @@ private void createImageOpener() { } private void createImage() { - image = new Element("object"); - image.setAttribute("type", "image/svg+xml"); - image.getStyle().set("display", "block"); - image.setAttribute("data", createResource()); + image = new Element("div"); + // image.setAttribute("type", "image/svg+xml"); + // image.getStyle().set("display", "block"); + // image.setAttribute("data", createResource()); + updateImage(); + getElement().appendChild(image); } + private void updateImage() { + StreamResource resource = createResource(); + image.setAttribute("non-existent", resource); + image.setProperty("innerHTML", + ""); + } + private StreamResource createResource() { return new StreamResource("image.svg", this::getImageInputStream); }