O'Reilly logo

Vaadin 7 UI Design By Example Beginner's Guide by Alejandro Duarte

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Custom JavaScript

Vaadin is really JavaScript friendly. You can call JavaScript from the server, create JavaScript components and JavaScript extensions not to mention GWT capabilities such as JavaScript native interface and JavaScript overlay types.

Note

For more information on GWT JavaScript integration, visit https://developers.google.com/web-toolkit.

Calling JavaScript from the server

Calling JavaScript from the server is as easy as this:

JavaScript.getCurrent().execute("alert('Hello from server side.')");

That's it.

Calling the server from JavaScript

We can call our server from the client side using JavaScript. We need to add a JavaScript function as shown in the following code snippet:

JavaScript.getCurrent().addFunction("myFunction", new JavaScriptFunction() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required