Problem setting values in DateField

Hi, i need some help.

I have a DateField in my app and when a value is setted by the user if it is not ok, i need to change the value of the component and i do like this:

**dateField.setValue(anotherDateField.getValue().plusYears(1));**

If i put a breakpoint i can see the component value updated with the correct value, but in the view i see the old and wrong value.

I use vaadin 8.3.1.

Any ideas?

Thanks

I tried with just this:

        DateField df = new DateField();
        DateField df2 = new DateField();
        df.addValueChangeListener( e -> {
            df2.setValue(df.getValue().plusYears(1));
        });

and it seemed to work for me (Vaadin 8.3.1). Maybe you have something else that is affecting things?

-Olli

Olli Tietäväinen:
I tried with just this:

        DateField df = new DateField();
        DateField df2 = new DateField();
        df.addValueChangeListener( e -> {
            df2.setValue(df.getValue().plusYears(1));
        });

and it seemed to work for me (Vaadin 8.3.1). Maybe you have something else that is affecting things?

-Olli

Thanks for the response.

I forgot to say that this component is associated to an object with a Binder.

The first time it seems to works but when i introduce other wrong value, the object associated with the binder and the component are updated correctly but i keep seeing the wrong value in the view.

Thanks again.

Maybe you should then just get rid of the Binder and do the binding for that property manually in the value change listeners?

-Olli