Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Load jQuery inside Custom Layout in Vaadin 7
How do you load jQuery and external js file inside custom layout ?
For example, I have following layout structure:
[b]MyExampleProject VAADIN themes myexampleproject img js -init.js layouts -mylayout.html[/b]
Of course I can add something like this:
Here is what Firebug reports:
FAILED TO LOAD RESOURCE: THE SERVER RESPONDED WITH STATUS OF 404
Btw: the annotation works best if the js file is in the same folder/package as the class that has the annotation.
The task that I am currently doing is a bit challenging because it requires AngularJS app to be included in Vaadin and some other legacy codes also embedded inside it too.
The good part is that AngularJS app works perfectly with Vaadin 7. However, I am struggling to play around with Custom Layout and jQuery features, still.
When integrated they can be used almost exactly like Vaadin layouts on the server side.
If you really want to stick to CustomLayouts remember:
- <script> blocks will most likely be cut out from your html but something like onclick="alert('Test')" won't
- all JS resources need to be published to be available on the server