I’m trying to figure out why an Item is updating values when I cancel the Edit of the item.
I just use “self.refresh_data_bindings()” when the alert returns “True”. So it wouldn’t happen when i returned other value whatever it is. But somehow it still binding the update. Do i need to change the way it’s updated? Or is it another problem that I’m not seeing?
Another question is why it doesn’t show the new data text
This is to do with a detail of how Data Bindings work, that I need to document better!
The write_back part of Data Bindings is triggered by certain input events. The TextBox and TextArea run the writeback on pressed_enter or lose_focus. So the data has already been written back to the Data Table before the alert is closed.
You’ll need to uncheck write_back, and explicitly specify what you want to happen when the alert is closed.
Here’s a modified version of your app. I’ve created a save_changes event on your Edit Form:
I’ll update our documentation to make the behaviour of write_back clearer. Thanks for mentioning this, posts like this help us improve our documentation.