on-change event did not get triggered

Hi,

I had a logonform in Polymer template html, and implemented a method like:

updateField( event) {
.....
}

In the Java side, I appended a TextField to the logonform template, and would like to add an annotated listener make the TextField trigger the method. The Java code looks like:

TextField field = new TextField( "Name: " );
field.setAttribute( "on-change", "updateField" );
logonform.getElement().appendChild( field );

However, when I typed in that TextField, the method didn’t get triggered. I am wondering how to add an annotated listender to custom element.

Best regards,
Joey

TextField field = new TextField( "Name: " );
field.addValueChangeListener(e -> {
	getElement().callFunction("updateField", e.getValue());
});

getElement().callFunction allows you to call a client method from within the Flow component

Thanks a lot. Joey