(Using Vaadin 18)
I have a value change listener on a combobox that opens a confirm dialog, allowing the user to confirm the change. Because this is within a value change listener, the value has technically already changed. Thus when they select "No" I need to revert the value. There doesn't appear to be any part of the API that can do this, aside from manually setting the value.
But when reverting via setValue(...) the listener fires a second time. I need to prevent it from firing again. Currently the only way I'm able to do it is with an extra "ignoreNextChange" boolean variable, which prevents the logic from running a second time. Is there an easier way to do this? I don't see anyway to add a listener that fires before the value change.
I can't simply ignore all non-client changes, because that breaks the binder. And altering the listener registration won't work from inside the listener because I would also need to add it back, which would cause it to fire anyway.