ShoppingList.fdf (2.9 MB)
Hi Frank,
You could use Five’s inbuilt function selectAction() to achieve this. I have attached another ShoppingList FDF for you to have a look at.
The FDF attached contains two forms, Shopping Lists and Items and are still linked up in the traditional way via the Shopping List menu item. This is the original method I showed you that had the Down button.
There is now a second menu item called Shopping List mobile and this menu item references the Shopping Lists data view. Click the VIEW button next to the Action field and this will take you to the Shopping List data view record.
If you have not used data views before, they are a way you can display the data you want in your application. Please note that in a data view, you cannot add shopping lists, this will need to be done via the original menu.
When you add a data view, you must select a data source and the data source will supply the fields to your data view. The Shopping Lists data view is using the ShoppingList table as its data source as shown in the image below.
If you click the Data Fields tab, you will see the fields from the table, shown below. The Shopping List data view displays the Name of each shopping list in the list.
The Name column has a display type of _Text and has a function attached to the On Click event. So effectively the Name field becomes a button in the list.
The SelectShoppingList function attached to the Name field, when clicked it will push the ShoppingListKey into the stack so when selectAction() is called selecting the Items form action ID, the items will be displayed filtered by the shopping list.
The Items in the Shopping List app will be displayed when the shopping list name is clicked in the list as the ShoppingListKey has been pushed into the stack. The Items form behaves like it would normally act in the original setup using just forms and the drill down. Please note that I added a boolean field to click whether to buy the item or not.
A new item can be added here or you can select a record in the list.
A Back button was added that will return you to the Shopping List.
You can see this on the Items form on the Action Button record.
It is using the other function called backToShoppingList() attached to the On press event for the Back action button on the Items form.
Here is a link to understand Five’s stack:
You can edit the size of the button by using the Display field on the data field record on the Data View form. In mobile mode the buttons look better and should not need editing as they are just the width of the phone.
I hope this helps you to achieve what you are after Frank!