Cancel Value Changed Event


I have a NativeSelect that I wanted to warn users and let them confirm before the value changes. In C# + Windows application development, in the value changed event handler, you can put the confirmation code there, and have th event canceld, if the user cancels. Is there a similar way of doing this in Vaadin?


Hi Colin,

There is no event cancellation. Instead you could use buffering feature of Field to implement your use case. First, set your NativeSelect as buffered and set a property datasource into it. Then you can call commit or discard to the field regarding does the user accept the change or not.

More info about buffering in Book of Vaadin

OK, thank you very much for the explanation.