TextChangeEventMode.EAGER not working?

I’m trying to replace some SuperImmediateTextField code with regular TextFields using TextField.setTextChangeEventMode(TextChangeEventMode.EAGER).

Unfortunately I’m not seeing the immediate callbacks that I got with SITF. I’m not even seeing them after a timeout. The only way I could find to trigger the callbacks is to change the focus to another window.

Is this supposed to be working? Am I doing something wrong?

Here’s a summary of my code:


class Dialog extends Window implements Property.ValueChangeListener
{
    public Dialog()
    {
        TextField name = new TextField();
        name.setTextChangeEventMode(TextChangeEventMode.EAGER);
        name.addListener(this);
        name.setImmediate(true);
        VerticalLayout layout = new VerticalLayout();
        layout.addComponent(name);
        setModal(true);
        setContent(layout);
        setWidth(300, UNITS_PIXELS);
        name.focus();
    }

    @Override
    public void valueChange(Property.ValueChangeEvent event)
    {
        Property property = event.getProperty();
        if (null != property) {
            String value = (String)property.getValue();
            System.err.println("new value '" + value + "'");
        }
    }
}

Nevermind.

Just found out that I need to register a TextChangeListener instead of the Property.ValueChangeListener I used for SITF. Then it works.