It can be helpful to assign a status to each item in the list. This way, when you walk in the supermarket, you can mark the items you have already bought.
Adding a field is easy, using the 'Table Wizard':
The wizard will update your model with the additional field in all relevant places. If you now save your model and restart the appliaction, you will be able to update the status of any item you choose.
Updating an item's status requires the selection of its row in the table, pressing the 'Update' button, entering the new status, and pressing 'Save'.
Walking in the supermarket with your iPhone, you may prefer a one-click method to mark an item you buy. To support this, we can add a 'Got It' button to mark an item as bought:
The straightforward way is to create the 'Got It' button in the 'Action Header Group' of the row above the item table (the group with the existing buttons 'New', 'Update' and 'Delete'):
Items: Right click, select Add Ancestor Reference, and select the 'Items' element.Convert Row to Record: Drag from the model repository from the package 'ShoppingList/Desktop/Items/Wizard/Transformations'.Create Parameters, Sve Update, Refresh Page: Copy from the 'Save' button inside the footer of the 'Update' dialog (go to 'Save/<On Click>', select the 3 elements and the flows between them, and select Copy; then return to 'Got It' and select Paste (Reuse)).√: Create a text constant with the value "√".
If you now restart the application, you will only need to select a row and press 'Got It', and its status will be changed to √.
Download Model: Stage 5, Interim Model (version 2.4.1)
To make 'Got It' a truely one-click-button, we would like to save the need to select a row before pressing the button.
This can be achieved by putting a 'Got It' button in each table row – clicking the button will change the status of its row.
Modeling is trivial:
Once an item is marked as bought (√), we no longer need the 'Got It' button in its row.
Actually, if we only display the buttons for the other items, we will make it easier to see which items we still need to look for on the shelves.
We can model this by displaying the 'Got It' button only if the item's status is different from '√':
If you now restart the application you will notice that when you press 'Got It', the item's status changes to '√', and the 'Got It' button disappears.
Download Model: Stage 5, Final Model (version 2.4.1)
Next: Classifying items by (mutually exclusive) categories
For best results, use the Firefox browser..