Hi peeps,
I’m just moved my whole js out of the java class in an external .js file as it is tidier, but I don’t seem to be able to get the script called.
I added it here: src–>main–>webapp–>VAADIN–>themes–>mytheme–>resources–>script.js
In my java file I have this:
@com.vaadin.annotations.JavaScript({"https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js", "resources/script.js"
})
and a function call:
JavaScript.getCurrent().execute(""
+"jsInit();"
+"");
but when I test the app I get an error saying:
"NetworkError: 404 Not Found - http://localhost:8080/apptest/APP/PUBLISHED/resources/script.js"
I’ve had a look around but nowhere I couldn’t find anywhere clear instructions as to exactly where the js file goes. Mine is a maven project using spring suite
thanks
Right, looks like if you put it in src/main/resources/my/vaadin/apptest (apptest being the name of my application) it works OK. There is another file in there by the way, MyAppWidgetset.gwt.xml, but it doesn’t seem to be causing any problem. One thing I 'm wondering though is that in the same js file I’d like to add my connector (I know I shouldn’t put it in the same file but for now that’ll do because I’m pretty new to vaadin and I’d just like to get it working then if it does i’ll move it to another js file). DO you reckon it would work?
thanks