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.

format date when typing

Fabio Ebner
5 years ago Nov 01, 2016 5:00pm

I have one field birthday in my form, so I put one dateField but it`is difficult to my user to find the oldest years, so I need to when my user is typing I have to formater the value, so I try to use this:

this.setImmediate(true);
            this.addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    String value = (String) event.getProperty().getValue();
                    valida(value);
                }
            });

but he only execute the valueChange, when I select one date, How can I execute my method when user is typing