Loading...
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.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

running javascript

christos melas
1 decade ago Sep 18, 2009 10:25pm
Sami Ekblad
1 decade ago Sep 20, 2009 9:55am

I recently investigated the same topic.

I found two ways of invoking external JavaScript directly (inline) from Vaadin: Notification and CustomLayout. I know that both of these are more or less "wrong way to do this" and IRL you should actually have some kind of component/widget for this. Maybe framework could implement this? Vote for this at UserVoice

Anyway, here are my hacks. Test and read more here:
http://uilder.virtuallypreinstalled.com/run/Calling_External_JavaScript/

Joonas Lehtinen
1 decade ago Sep 20, 2009 4:28pm
Sami Ekblad
1 decade ago Sep 20, 2009 5:25pm
christos melas
1 decade ago Sep 20, 2009 5:36pm
Jens Jansson
1 decade ago Sep 21, 2009 6:55am
Joonas Lehtinen
1 decade ago Sep 21, 2009 9:34am
Xichuan Wu
8 years ago Jul 23, 2014 4:08pm

@christos melas, in which directory should I put this custom_layout_with_js.html in order for it to be loaded in the main page?
I have a vaadin project, and added your sample html file under /WebContent/WEB-INF/. When I run this project, I get a message

Layout file layouts/custom_layout_with_js.html is missing. Components will be drawn for debug purposes.

Any idea/tip is appreciated!
Regards, Xichuan.

 

Xichuan Wu
8 years ago Jul 23, 2014 4:32pm
Somayeh Soleimani
7 years ago Jul 01, 2015 2:52pm