Simple addresses on global tinydb

I believe this is an attempt to modify my aia address_1.aia (5.8 KB) provided in difficulty creating an address book. In this in tinyDB is saved a list of lists in which each entry contains name, surname, address, telephone number

On Screen initialize we check tinyDB to see if has values and if yes creates ListView, else you won't see anything

When user fills details and clicks Bt_aggiungi if all details are filled, a list is added to global data, saved in tinyDB and then call a procedure to create ListView since we are working with a list of lists

After an entry is picked, textboxes are populated again in order to make changes

In case we want to delete, we remove entry from global list, save to tinyDB, refresh ListView

In case we want to update entry, we replace entry in list, save to tinyDB, refresh ListView

I marked some of the problematics parts in your code, For example you set ListView.elements after picking but you have to do it prior when button save is clicked in order to see the listview and be able to choose an entry. Also when button save is clicked you just add items to list but then in salva_elementi you save a list which every time you create a new entry will be overwritten

2 Likes