Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
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.
However, sometimes the application gets into a mode where deleting the last 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:
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?
Leif Åstrand: Which versions of Vaadin show this behavior? In which browsers?
This was with 7.0.0.alpha1. Haven't tried it yet with alpha2. I am testing with Firefox 11.