HI to All Experts 
What I’m trying to do:
I am trying to learn Anvil and have made a sample application, connected it with Database. Now I want to EDIT the data.
What I’ve tried and what’s not working:
I have gone through this article (Anvil | Allow users to edit movie data), but still things are not clear to me.
Like, How ANVIL has captured the data in the text box of alert WINDOW.
Writer didn’t mention something like this code -
self.textbox1.text = db.field1
So I need your support, guidance to understand the concept of EDIT. Kindly help me on this, I will really appreciate your support. Thanks in advance!!
Welcome to the Forum!
Your confusion is understandable. Tutorials are often very strong on how-tos, and less strong on why-tos, and the underlying concepts and principles behind the hows and whys.
That tutorial relies on the shortcut of Data Bindings. In a nutshell, when you use Data Binding, you tell Anvil to generate behind-the-scenes code that copies data from one place to another, and (usually) back again. In this case, the generated code copies text
- from the database row to a live TextBox on-screen, where the user can edit it
- from the TextBox back to the database row, when the user has definitively stopped editing the TextBox contents.
This can be very confusing at first, as the code that does this work is not visible to you. Even the code that triggers the work is hidden. In fact, none of that Python code is kept around, for you to look at later.
However, you can see what such code might look like here: Equivalent functionality from code.
Data Binding is a mechanism that is built on several other mechanisms, so it may help to look at them first in the Docs and Tutorials: User Interfaces, Events, Databases.
These, in turn, are built on Python’s object-oriented features.
So, you can go as deep as you feel comfortable doing now, and expand on your knowledge bit by bit as you go.
3 Likes
That tutorial assumes you’ve already gone through the Data Bindings tutorial: Anvil | Data Bindings
2 Likes
Hi, Thanks! I understood the concept and was able to do the binding, searching and capturing the data in the relevant fields. Thank you so much for the help. Have a great day 
2 Likes