I have here a fine checkbox display app (thanks @ABG , @TIMAI2 2, et al). I am now trying to educate myself with TinyDB by saving and recalling a database that saves the checkbox order that is displayed below the three buttons. In my dreams, the buttons allow you to save and recall data and return to the data entry page. I would ultimately like to save several TinyDB readings of data.
Could someone direct me to some applicable material that I can wrap my brain around, or show me the error(s) of my code and how to properly expand it to allow several stored datasets? I appreciate any help with this, as I have spent several hours doing noting but digging deep and empty data holes with the TinyDB and List instructionals and I have yet to find myself instructed,(. .
Thank you for that observation. The list was named MyCheckBoxes. I changed a couple of tags but that didn't seem to help. If you have an opportunity to look, I re-uploaded my .ala file and checked to make certain I did so properly. I think I am trying to make this more difficult than it needs to be, but I don;t know where to simplify.
This is the code I added to ONLY save your checkbox list across runs of the app, and to reload the checkboxes at startup.
I also removed code that presumptuously cleared all checkboxes on the way back from viewing data, with the side effect of clearing the saved list.
I used the same tag text as the name of the global list I saved, to avoid confusion.
Notice how the list of checkbox components I traverse is global MyCheckBoxes, specifically set aside for just that purpose. I set the Checked attribute of each checkbox depending on whether or not the checkbox Text is in the list Checkbox_List (which is just the names of the checked boxes, in their order of having been checked.)
This is how I save the global Checkbox_List for the next run, in a procedure where I use the same tag as the prior procedure, hidden away from the fingers of fumblers.
This is the same Cleckbox Changed event as before, except at the very end I always update TinyDB through my new procedure save_Checkbox_List. This way, the saved list is always up to date, regardless of how and who updates the check boxes.
I am almost too ashamed to write to you, but I cannot figure out what you did or what it improved. I was watching your movie but it didn't make much sense, as I download everything to my Android directly. I downloaded the code to my computer and then to my phone but it didn't work any differently than before.
While you may have been shouting out to me, I couldn't hear what you had to say about what I missed or what you found. When I removed the return to data selection button choice, I was forever stuck in the data display page. I also cannot figure out how to ask the file you created to show me the saved selection. Every time I click the "Retrieve Data" button, a "0" appears on the screen below and not the sequence I think I entered into TinyDB.
Can you tell me what I am missing here? I do not feel that a "eureka" moment is on the way without another bone or two tossed my way.
If I had only one question to ask here, it would be "How do I get the data stored in TinyDB to show itself when I press the "Retrieve Data" button.
And thank you for your patience here with me. I was really hoping to grock your response but I am missing that which, I believe, you really hoped I would get on my own.
Thank you for the explanation. It was too early this morning to grock what you were saying (or demonstrating;). I will now play with taking what you have done and also applying it to the data represented by each checkbox (currently "0").