Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 1 week ago
vaadin icons in server side polymer paper-icon-button
Hello
I'm using the Elements Add-on to use polymer elements on the server side.
I implemented a PaperIconButton which works with the "src" attribute.
import org.vaadin.elements.Element;
import org.vaadin.elements.Elements;
import org.vaadin.elements.Import;
import org.vaadin.elements.Tag;
@Tag("paper-icon-button")
@Import("/VAADIN/bower_components/paper-icon-button/paper-icon-button.html")
public interface PaperIconButton extends Element {
public static PaperIconButton create() {
return Elements.create(PaperIconButton.class);
}
public static PaperIconButton create(String icon) {
PaperIconButton button = create();
button.setAttribute("src", "/VAADIN/icons/" + icon + ".png");
return button;
}
public static PaperIconButton create(String icon, String tooltip) {
PaperIconButton button = create(icon);
button.setAttribute("title", tooltip);
return button;
}
}
I would like to use the "icon" attribute instead, so I can use the vaadin icons, e.g.:
button.setAttribute("icon", "menu");
According to this link https://vaadin.com/icons/download I need to include the following:
<link rel="import" href="bower_components/iron-icon/iron-icon.html">
<link rel="import" href="bower_components/vaadin-icons/vaadin-icons.html">
How do I manage this on the server side? Use @Import like for the Demo PaperButton?
@Tag("paper-button")
@Import("VAADIN/bower_components/paper-button/paper-button.html")
public interface PaperButton extends Element {
I can't use multiple @Import:
@Import("/VAADIN/bower_components/iron-icons/iron-icon.html")
@Import("/VAADIN/bower_components/vaadin-icons/vaadin-icons.html")
public class ViewerUI extends UI {
Am I on the wrong track?
Last updated on
You cannot reply to this thread.