Please, think that I am stupid and do not understand easily.
I have done these...The problem is the same
Look at the Taifun response...the same here:
and only "set global list" and "set ListView" in the procedure:
The problem remains!!!
I think you finally didn't implement this...to avoid storing in TinyDB when the input fields are empty.
Unfortunately I'm stuck, I can't find a way out.
And the stupid joke is that I try so hard and I'm still in the same place and sometimes I make it worse.
Not there...Which is your problem? you don't want to store in TinyDB anything when your textBoxes are empty, right? So, that is the part you have to protect with the if statement. So, before to add item to the list, and before to Store a new value, check if the textBoxes or whatever you want are not empty.
You can nest as many conditions as you want in the if statement.
I want: After I press the button add and I have written the fields only then data that I have written is saved.
And when one day I want to delete them, so that they are all deleted and not appear again every time I press the button add.
The button add should only put the new data, not the ones I deleted, and put them back again and again, every time I press this button.
When you have a new item, you are adding it to a list and is that list what you are storing in TinyDB, and that list is what you are displaying in ListView.
At this point, you need to check if the fields to add to the list are empty or not (this is what I understand you were requesting in before responses..).
To delete item, you need to do the same, that is, remove the item from the list and, with the new list (without the removed item), store it in tinyDB and display this list in ListView.
When you start the app, you have to read the tag from tinyDB, initialize that list with whatever is stored in tinyDB and display it is ListView.
Now it works correctly, it deletes everything with the delete button and doesn't put it back together with new data
It certainly has many shortcomings, which I can't think of at the moment.
If you want I can upload the AIA file
I think it's time for you to understand what you do in your code, how it works and how to assemble the pieces...otherwise, as we have already proven, it is very difficult to move forward without knowing what you are doing.
So move forward step by step, first one thing and, when it is resolved, the next.
You can start, for example, by checking whether the fields are empty or not, to create a new element.
Right, I agree...
For this app
Even better would be if after adding some invalid data by mistake, I could select those invalid data and delete only those, i.e. also +an option to delete data by selection
For that point...this is the event triggered when you chose an item in the ListView:
and this property indicates the index of that element:
So, after select an item in your ListView, you can write inside that event whatever you want to do. In your case, to remove the item from the list. You can do it using list blocks and the SelectonIndex.
Then, once the item has been removed from the list, you have to store the list in TinyDB and display it in ListView.
Now I'm going to play with it, I'm going to try it.
I thought it would be nicer if I could also put statistical tables showing the progress of the measurement findings
For the table, you could use this:
With Charts it is not possible to make a display table with these graphics
with Chart component? No...you can make charts...but not a table like that.
Extremely difficult for me to do.
I couldn't even do the previous question
I'm a beginner and trying to learn on my own with what I can grab here and there...
Have you ever heard of Murphy's Law?
It should be in your mind constantly as you code.
When you are dealing with TinyDB, there are at least two things that can go wrong when you do a lookup:
- Nothing comes back, so you must code a proper default value that will support whatever operations (math, lists, dictionaries) that you will perform on the returned value
- Something left over from testing or another app(if in the Companion) comes back, that needs to be checked using the Is A ... blocks.
Here is some super bulletproof code for retrieving a list of employees from TinyDB ...
In this sample code, I force whatever comes back to become a list, because I must have a list.
Can anyone learn the alphabet starting with Ω or Z and then go to R or A and then continue to P etc.?