Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

after TextChangeEvent TextField doesn't change it's value

chan guang
1 decade ago Jul 04, 2011 2:15am

Direct post code:

public void init() {
setMainWindow(mainWindow);
final TextField txt = new TextField("text");
txt.setImmediate(true);
txt.setTextChangeEventMode(TextChangeEventMode.EAGER);
txt.addListener(new TextChangeListener() {
@Override
public void textChange(TextChangeEvent event) {
System.out.println("current value : " + txt.getValue());
System.out.println("event value : " + event.getText());
}
});
mainWindow.addComponent(txt);
}

txt.getValue() always retun the old value of the last state,but event.getText() works fine.

Last updated on Jul, 4th 2011
Marc Englund
1 decade ago Jul 04, 2011 6:20am
chan guang
1 decade ago Jul 04, 2011 8:27am
Johannes Peeters
1 decade ago Jul 07, 2011 8:16pm
Marc Englund
1 decade ago Jul 08, 2011 2:17pm
Johannes Peeters
1 decade ago Jul 12, 2011 9:04pm
Henri Sara
8 years ago Sep 03, 2014 6:11am
behnaz bagherian
5 years ago Mar 31, 2017 7:31am