Hi all,
I am quite new to Vaadin Components and I’m trying to wrap an Alloy UI Component in Vaadin.
It seems, that everything works fine as long as I annotate the UI Class with
@JavaScript("https://cdn.alloyui.com/3.0.1/aui/aui-min.js")
But as soon as I move the Annotation down to Component Level it stops working.
package diagram;
import com.vaadin.annotations.JavaScript;
import com.vaadin.annotations.StyleSheet;
import com.vaadin.ui.AbstractJavaScriptComponent;
@JavaScript({ "https://cdn.alloyui.com/3.0.1/aui/aui-min.js", "diagram-builder.js" })
@StyleSheet({ "http://cdn.alloyui.com/2.5.0/aui-css/css/bootstrap.min.css", "styles.css" })
public class DiagramBuilder extends AbstractJavaScriptComponent {
public DiagramBuilder() {
}
}
The only difference (it seems) is that in this case the framework generates the following Element in the :
<script src="https://cdn.alloyui.com/3.0.1/aui/aui-min.js" type="text/javascript" async=""></script>
While when I annotate at UI Class level I get
<script type="text/javascript" src="https://cdn.alloyui.com/3.0.1/aui/aui-min.js"></script>
and the component is working as expected.
However as - at the moment we use this component only in one place we do not want the whole application to load the script.
Is there any way I can prevent the async being added? I found some information on ResourceLoader but this cannot be used in my DiagramBuilder class.
Any help is greatly appreciated.
Thanks,
Filip