Hello,
I want to execute a javascript code when a button is pressed and followed
https://vaadin.com/docs/v8/framework/gwt/gwt-javascript.html
Here is my component code:
package si.web.NLUCentral_Web_vaadin;
import com.vaadin.annotations.JavaScript;
import com.vaadin.ui.Button;
@JavaScript({“sendAudio.js”, “sendAudio-connector.js”})
public class ListenButton extends Button
{
/**
*
*/
private static final long serialVersionUID = 1L;
public ListenButton(String caption)
{
super(caption) ;
}
}
Do I need to follow also the section “RPC from JavaScript to Server-Side” ?
When I published from Eclipse (has the Vaadin plug-in) the directory APP/PUBLISHED
was not created. What do I need to do in order to have it created?
I created the directory manually and copied the two “.js” files there.
Still, when refreshing the page I get a message saying that load failed for
http://localhost:8080//APP/PUBLISHED/sendAudio.js” as well as for
“sendAudio-connector.js”
Please advice, is there an example of connecting JS to a button?
Many thanks,
Yuval