Data binding error: initializing binding sources before initializing component

What I’m trying to do:

I’m working off of the to do list app from the storing and displaying data demo here: Storing and Displaying Data

Made a few modifications to the example app. I’d like to be able to add, remove, and add items again.
I’m running into an error when I delete an item from the list and then try adding an item again:

“anvil.tables.TableError: This row has been deleted. Did you initialise all data binding sources before initialising this component?”

Very simple mistake. Can you give me a pointer on what is going wrong here?

Clone link:
https://anvil.works/build#clone:K5GLZC42SVBZME2E=WD3JK2LUZCLSP5TTUZFG6EOJ

Excellent question, Joseph.

Actually, this is really straightforward. The cloned version of the To Do list app is different than the one that is built in the video tutorial. It is simpler to just use the cloned app with the simplified button click function.

def button_1_click(self, **event_args):
    """This method is called when the button is clicked"""
    app_tables.reminders.add_row(description=self.new_reminder_box.text, done=False)    
    self.repeating_panel_1.items = app_tables.reminders.search()

The first line add the new row to the database.
The second line (re)initializes the binding.

4 Likes