TextField input listener gives old value

Hi!
looks like the text field has at time of event not the new value . Is there a workaround to get the new value directly once a button has been pressed ?

  tf.addInputListener(event -> {
            calc(tf.getValue());
        });

IIRC, server-side value is not updated on input event.
To be notified about value changes, you can use the addValueChangeListener() method.
What’s the reason for using an input listener?

Perhaps what you are looking for is the setValueChangeMode() method.
Setting it to EAGER should notify the server about every value change on the client side, but it could significantly increase the network traffic.

I want to calculate something once the value was changed.

using valueChangeListener and add .setValueChangeMode(ValueChangeMode.EAGER); before adding the listener works :) In my previous code the setValueChangeMode was called after i added the ValueChangeListener (must be before it)

Thank you!

Normally the default value change listener is enough. Only special case comes when e.g. the mentioned button is triggered by key actions like enter… other than that it should be fine without increasing chattyness