TextChangeListener sometimes does not get called

I am implementing a TextChangeListener on TextField. The first two lines of the textChange() method are currently:

final String filterText = event.getText();
System.out.println("TextChangeListener:textChange: filterText is: " + filterText);

so that I can see when the listener is being called. When I type and remove characters from the field, the listener gets called and the activity on stdout shows what the text is as each characters is added or removed.

the application gets into a mode where deleting the
character in the text field does not cause the TextChangeListener to be called.

Once it is in this mode, it is completely reproducible: I can add and remove characters from the TextField, but the deleting the last one does not trigger the TextChangeListener. The only way out is to restart the application.

Unfortunately, I have not yet been able to determine the circumstances where it enters this mode. If I notice any relevant details, I will add them to this thread.

This sounds like an quite interesting bug, though I can’t immediately find any obvious cause for it. Which versions of Vaadin show this behavior? In which browsers?

You could also check the debug console (add ?debug (or &debug)) to the URL in the browser to check whether the text change is sent to the server. Knowing in what part of the framework the change gets ignored could help figuring out where it goes wrong.

This sounds remotely familiar. I have come across myself with something similar a while ago. I can’t remember the details but a search on dev.vaadin.com gave this issue:

Ticket #8145 - TextChangeListener: textChange(TextChangeEvent) is not triggered when the text is equal to the value of the field

In it’s shortness, if you change the text back to what it was set to on the server side. A usual case is that textfields are empty when initialized so removing the last char would return it to the original state. Do you think that this is the same issue reappearing?

This was with 7.0.0.alpha1. Haven’t tried it yet with alpha2. I am testing with Firefox 11.