Closed Fritz75 closed 7 years ago
If you use widgets in your ui.xml
you should use widgets in the .java
You code works if you modify:
<p:PaperToggleButton ui:field="myToggle" />
@UiField
public PaperToggleButton myToggle;
....
myToggle.getPolymerElement().addEventListener("iron-change", e -> {
console.log("Change");
});
I'm using UiBinder and want to add a PaperToggleButtonElement and then add an event:
XML: /p:PaperToggleButton
Java class: @UiField public PaperToggleButtonElement myToggle;
myToggle.addEventListener("iron-change", new EventListener() { @Override public void handleEvent(Event event) { //doSomething } }); in developer console I get this.myToggle_1_g$.addEventListener is not a function
Please, can you help me in any way?