Nikos Tzovaras

unread,
May 11, 2017, 7:58:32 AM5/11/17
to mitappinv...@googlegroups.com
Hi. I want to build an application that takes data from one screen and lists them on another screen. I use Tinydb to do this. My problem is how to delete a tag?.When I choose what to delete, it deletes it but if I get back to the screen from the beginning it shows the entire list without changes. I attach myBlock and my App  if anyone knows anything to help me. I searching for solutions 1 week now and i cant find something helpfull  Thank you.
Block.jpg
MyEventsListcopy.aia

SteveJG

unread,
May 11, 2017, 8:09:59 AM5/11/17
to MIT App Inventor Forum
After you delete the tag, the information is STILL in your events list.  After you delete the tag, use the TinyDB to refresh EventList and see what happens (yes the stuff in your initialize block).

Nikos Tzovaras

unread,
May 11, 2017, 8:16:10 AM5/11/17
to MIT App Inventor Forum
Thank you for your immediate reply. I have tried this without result. I think after deleting the tag I have to store the change on my tinydb. The problem is that i dont know how

SteveJG

unread,
May 11, 2017, 9:11:38 AM5/11/17
to mitappinv...@googlegroups.com


You deleted from your ListPicker but you do not delete the item from your TinyDB.   The tag field cannot be empty, it needs to be the tag that was saved which is the date (the tag) .you save on your AddEvent screen.  This ;possibly is the  ListPickerDelete.Selection  block?  You probably will have to parse out the date from the selection because the ListPickerDelete shows the tag and its contents.  You only want the tag.    Also, this would be easier to debug if your font for the ListPicker were something smaller than 60 ... perhaps 14?   Easier to read too.l


Nikos Tzovaras

unread,
May 11, 2017, 9:48:57 AM5/11/17
to MIT App Inventor Forum
Thanks again for your answer. I understant that you tell me but i cant understant what must put in Tag. The problem is that the tag date is in another screen and i dont know how to tag in this screen. Sorry but  i am new in MIT . I made all the tutorials but noone tutorial have this explain. Thank you for your support. Maybe i need more education on this. 

SteveJG

unread,
May 11, 2017, 10:47:16 AM5/11/17
to MIT App Inventor Forum
It does not matter that the date tag was input on another screen.  The TinyDB shares the tags across screens.  What you place in the Tag you want to clear is a DATE.   

In your ListPicker, the event contains both the date and the event.  Separate the date from the event information using the red Text blocks.  You can use the following blocks:



The TinyDB block is shown from the other screen  ONLY to show where the Tag date comes from.

Change your blocks and try your app.  It should properly delete the event you select..

Regards,
Steve

Nikos Tzovaras

unread,
May 11, 2017, 12:21:49 PM5/11/17
to MIT App Inventor Forum
Thank you so much. That was the right tag. Thanks a lot!!!

Ayman Nadi

unread,
May 12, 2017, 2:57:40 PM5/12/17
to MIT App Inventor Forum
Here is another way to delete tag. 
you need to create list of tags in addition to your list of values.
you saved tags by date which means you can have 1 event only on that date, if you join date with time then you can have multi events in 1 day :)

1.jpg
2.jpg
Reply all
Reply to author
Forward
0 new messages