There is one cancel when I bind my bean?
I need to be one bind immediate but I want to put one button “Cancel” when my user click I need to reset my bean to initial value
tks
There is one cancel when I bind my bean?
I need to be one bind immediate but I want to put one button “Cancel” when my user click I need to reset my bean to initial value
tks
I think you’ll probably need a copy / clone of your original bean so you can revert back to it when the cancel button is pressed.
-Olli
Generally, a framework like Vaadin cannot provide rollback functionality because it does not (and cannot) know what your setters do.
Let’s say you implement basic rollback functionality that just makes a clone and then upon rollback reverts the values to those from a clone, but one of your setter methods updates a database index (say you need some sort of unique key). Then you would need to roll back the index as well as revert the field values.
If you want “cancel” functionality with unbuffered mode, you just have to provide it yourself.
I thought this was the use case of binder.writeBean, isn’t it? What do you mean with unbuffered mode?
Unbuffered means that the changes are automatically committed/updated to the bean etc.
E.g. from Vaadin Grid Editor interface javadoc (
https://vaadin.com/api/8.1.2/com/vaadin/ui/components/grid/Editor.html#setBuffered-boolean-
): ‘When the editor is in buffered mode, edits are only committed when the user clicks the save button. In unbuffered mode valid changes are automatically committed.’
BR, Katri