Custom Java Script Function in Vaadin

Hello every one.
I need to add a custom funtion in my java class to set it to my button click listener, how can I do this?

Why do you want to add a Javascript listener to your button, why is the Button.addClickListener not enough?

Hi John
Thanks for reply.
I meant, I need to call the javascript funtion in my button click.
For interaction with DOM I need to write a java Script Function, is it the way I have selected?

In your button click listener you could use


getPage().getJavaScript().execute(“”);

to invoke the javascript methods.