Skip to first unread message

highjack...@gmail.com

unread,
Jun 29, 2014, 4:45:58 AM6/29/14
to mitappinv...@googlegroups.com
Hello!

I have made an app which I would like to add another feature to: I want people to be able to make lists (4 of them) and by clicking an image it would store a certain text in a TinyDB, also using the listpicker for them to be able to see the list and erase one of the items in the list as well as the whole list by another button press. So far so good, I have managed to get that working just fine with one TinyDB.

BUT, I wonder if there's a possibility to have say 4 checkboxes (and 4 TinyDB), so they can chose which list to add their choices to? 

If Checkbox1 is checked then it would store the value from any of the buttons (there are 70 of them, but they will only click between 10 and 20 for their lists) into list1, if checkbox2 is checked then the value from the buttons would be stored into TinyDB2, and so on...

I am quite new to AppInventor and any programming, so any input in this would be greatly appreciated!

/Anneli

phantomfoot

unread,
Jun 29, 2014, 8:24:08 AM6/29/14
to mitappinv...@googlegroups.com
It's no use having more than one TinyDB. Even though you can add more than one TinyDB component, there is only one DB for each app. They will all point to the one TinyDB.

Taifun

unread,
Jun 29, 2014, 10:15:47 AM6/29/14
to mitappinv...@googlegroups.com
first do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor

you can store your lists in different tags in only one TinyDB (there is only one TinyDB in your app)

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         

highjack...@gmail.com

unread,
Jun 29, 2014, 11:11:01 AM6/29/14
to mitappinv...@googlegroups.com
Yes, I've done the tutorials and watched a LOT of videos (how to's) and tried to read up on the subject... ;-)

So, using 4 different tags in one TinyDB would be ok. Thanks! But how do I get the choice of putting it in different lists by pressing the same buttons? I would like to check in Checkbox1 to store the value of the button in tag "List1" in TinyDB as well as in Listpicker1 and when checking checkbox2 to store the value in tag "List2" in TinyDB and Listpicker2 etc. Is that even possible?

The buttons/images have a textvalue when pressed which it stores as in this case the first button is pressed as "101. Sitt" (it's an app for dog obedience training - in Swedish, why the weird spelling...) into TinyDB. But how do I connect the checkboxes with the different listpickers and tags in the TinyDB? This is what I have done so far, but am really stuck trying to figure this out... 


M. Hossein Amerkashi

unread,
Jun 29, 2014, 11:15:54 AM6/29/14
to mitappinv...@googlegroups.com
A problem with your code is that you are adding items to specific ListPicker (based on checkbox). However, when unchecked, you are not getting rid of that item from your ListPicker.

-Hossein.

highjack...@gmail.com

unread,
Jun 29, 2014, 11:30:14 AM6/29/14
to mitappinv...@googlegroups.com
I have other blocks that will "pick up", put into a textfield and remove (with button click) from the listpicker - and that is working fine (as of now). But I don't know how to specify the textvalue into the TinyDB or the correct listpicker by clicking the button. And, as I said before, I don't even know if it's at all possible the way I want to do it?

M. Hossein Amerkashi

unread,
Jun 29, 2014, 11:41:57 AM6/29/14
to mitappinv...@googlegroups.com
Shouldn't your List1..4 store your ListPicker1..4.Elements ??

-Hossein.

highjack...@gmail.com

unread,
Jun 29, 2014, 11:54:14 AM6/29/14
to mitappinv...@googlegroups.com
How do you mean???

highjack...@gmail.com

unread,
Jun 29, 2014, 12:03:47 PM6/29/14
to mitappinv...@googlegroups.com
Should I perhaps instead put the choice "if/then" under each button? So it's easier to specify the value it should store under each tag in case of checkbox1.checked? Do you think that would work?

highjack...@gmail.com

unread,
Jun 29, 2014, 12:17:51 PM6/29/14
to mitappinv...@googlegroups.com

Like this...?


Stephen Zipprich

unread,
Jul 1, 2014, 6:14:14 AM7/1/14
to mitappinv...@googlegroups.com
So, using 4 different tags in one TinyDB would be ok. Thanks! But how do I get the choice of putting it in different lists by pressing the same buttons? I would like to check in Checkbox1 to store the value of the button in tag "List1" in TinyDB as well as in Listpicker1 and when checking checkbox2 to store the value in tag "List2" in TinyDB and Listpicker2 etc. Is that even possible?


Here's a (hopefully) simple way to do it.

Four different lists, a textbox for adding an item to a list, the save button and the listpickers to display each list.  There's also a label for ensuring data validation (it's just empty at app start).

 Create a procedure to populate the listpicker elements at app start as well as when the list is saved.  You only need one list for this example.

We need to make sure we have only one list selected to add the item to, so we simulate radio buttons using checkboxes.

Now we create the TinyDB tag, add the textbox value to the list (so long as the user checked a box!) and update the listpickers.


FourLists.aia

Stephen Zipprich

unread,
Jul 1, 2014, 2:51:23 PM7/1/14
to mitappinv...@googlegroups.com
I got this email from the OP:

Thanks a million. I have used some of the stuff in your example and converted into using buttons with images to store the assigned textvalues from each button in different tags and it's working!!!!!!!! Yay!!!!!! :-D

Glad to hear you got it working.
_________________________________________________________

Reply all
Reply to author
Forward
0 new messages