-1

In Vaadin Label , I set a html content as String . That html is consisted of a html form and javascript+jquery related stuff for form submission and other processing.

Even though the form is correctly loaded to the UI , the javascript stuff is not working .

So what can be the reason ? . Is there any otherway to do this ?

chathura
  • 31
  • 1
  • 5

1 Answers1

0

To execute JavaScript from your server-side Vaadin code you should API provided by the JavaScript class, e.g.:

com.vaadin.ui.JavaScript.execute("alert('Hello World');");

But you must be very careful when you using this API, so I recommend this only for very simple JavaScript. For more complex cases you must create your own widget or extension by using GWT or Javascript on the client side.

Henri Kerola
  • 4,947
  • 1
  • 17
  • 19