Hello,
I am developing an application to update data in an Excel and it is working, but I need help on how to do a step.
The application works as follows:
I have a gallery that simulates a table with some Labels brought from Excel and some TextInput for the user to enter information that will be loaded/updated to Excel. For each "row" in this gallery, there is a Checkbox that, when checked (OnCheck), the information for the current line is loaded into a collection and when not checked (OnUncheck), the line is removed from the collection.
Thus, for each row that the user enters the data, he needs to check the Checkbox so that the information is loaded into the collection. And at the end, there is a Save button outside the gallery, which accesses the collection and updates the fields in Excel.
As I said at the beginning, all of this is working, but there is a problem that I saw today.
If the user enters the data in the fields and check the Checkbox, the data will be loaded into the collection, but if he needs to make a correction in the fields, the user would need to press the check again to deselect it (OnUncheck) so that the data can be removed from the collection, perform the changes and press the check again (OnCheck) so that the new information is loaded into the collection.
I don't know if this is the best way, but I thought this way:
So that users do not need to deselect the check to make corrections, I thought of a condition: If any field in the current row is inserted information or modified, I need to remove that line from the collection, and the Checkbox must be deselected, forcing the user to check again Checkbox for any modification that is made so that at the end of the modification, it needs to check again and so the data goes to the collection.
In short: If a line is changed, Uncheck the Checkbox and if there is data in the collection, remove it.
I don't know how to create this condition, could someone help me, please?
Thanks in advance