Alexei
Alexei

Reputation: 15726

Not call javascript function from vaadin 7

Vaadin 7

In my Vaadin app I want to call javascrtipt function onCustomName and pass param:

import com.vaadin.ui.UI;
String providerGUID = selectedProvider.getReference();
        UI.getCurrent().getPage().getJavaScript().execute("onCustomName(" + providerGUID + ")");

But nothing happened.

Upvotes: 0

Views: 174

Answers (1)

Tatu Lund
Tatu Lund

Reputation: 10643

onCustomName is not a built in JavaScript API in the Browser, so I assume you are using some JavaScript library in your application. You need to import it in the Java class using @JavaScript annotation. You probably need to do the call in attach event instead of constructor to ensure that call happens after library has been imported.

Upvotes: 2

Related Questions