BrokenImageFix for Vaadin
Fix for broken images in browsers. If you use an com.vaadin.ui.Image with an com.vaadin.server.ExternalResource in modern browsers and the image isn't available, a broken image is shown. Since there is no built-in functionality to hide these images, there was the need to develop this feature.
"is-broken" is the CSS class, which will be added to the surrounding containers of the missing images.
The server side part has to extend the container, where the possibly missing images are located.
VerticalLayout rootLayout = new VerticalLayout(); rootLayout.setId("container"); // ... rootLayout.addComponent(image1); rootLayout.addComponent(image2); new BrokenImageFix().extend(rootLayout);
Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.
- Apache License 2.0
- Vaadin 7.1+