Easy Navigation between Form / List / Table views in FIlemaker 11 using ‘View as:’

By: Jerry Salem

It doesn’t matter what route you take if you don’t have a destination

-or-

Trigger happy

One thing that I really like about the direction that FileMaker has been going in since version 9 has been how the programming environment now encourages of the use of native UI features in FileMaker in highly customized solutions.  Those of us who have been developing prior to FileMaker 9 – or those of us who have inherited solutions built before 9 –  know all too well what it means to lock down the Status Area and then build core UI elements from scratch to replace the lost functionality.  Many developer-hours have been spent to ‘reinvent’ features that were already in FileMaker, but in prior versions couldn’t be modified well enough to work in certain situations.

A clear, obvious example of this is the Toolbar.  Almost every single ‘professional’ system I have worked with by default hides the Toolbar, and then the developer is forced to reinvent the forward and back buttons, the book/rolodex widget, and every other element of the Toolbar using buttons and scripts on the layout itself.  What a waste of time!

In this blog post I’m going to look at one small segment of the Toolbar – the “View As” widget – as an example of how the Toolbar can be leveraged using Script Triggers.

The primary problem with the “View As” widget is twofold:

First, in highly customized solutions, not all layouts can or should be viewed in in all available View states. We simply don’t want our beautifully crafted layout designed for Form View to be viewed in List View by the user, for visual and possibly programmatic reasons.

The second aspect of this comes down to user expectations: if we’re going to have a List widget button on a toolbar, it stands to reason that the user’s going to expect that button to show a list view.  From a user’s perspective, why would the button be there in the first place if she can’t click on it?  Simply disabling List View in Layout Setup, in other words, won’t be enough to satisfy the user’s perception of what the List widget button should actually do.

What we really want is a View As widget that actually navigates to Form, List and Table layouts that we’ve designed especially for the purpose.

This movie illustrates the problem with the current View As buttons.

There are several possible solutions to this problem:

The ‘Knee Jerk’  Solution:  disable the “View As:” buttons.  This works but leaves tools on the layout that are grayed out.  It also forces the developer to add in navigation widgets to provide access to Form/List/Table views.

The FileMaker 10 Solution: add custom menus with scripts attached to the menu items that control “View As”.  Before FileMaker 11, this was the best solution to the problem – it satisfied all the requirements – but the technique requires FileMaker Advanced, and expert ability with custom menu manipulation.

The FileMaker 11 Solution: With the advent of FileMaker 11, we can now use the new script trigger ‘onViewChange’ to achieve the desired behavior without Custom Menus.  It also has the advantage that it does not require FileMaker Advanced, or any advanced programming background.

Solution Detail: For this example we are using one of the sample databases included with FileMaker 11.  Create a script called Navigation.  Here is the sample script I created to navigate between the three event layouts in the Event Planner database:


The script is basically self explanatory.  When it is triggered (by a change in view state) it checks for the new state, and then navigates to the correct layout and changes to the correct state.  To trigger this script, use the new script trigger on each of the form and list view layouts (and table view if you have one, I opted to use the list view).
ViewChangeScriptTrigger

Results:  Here is how the navigation works in the end.

0 Response to “Easy Navigation between Form / List / Table views in FIlemaker 11 using ‘View as:’”


  • No Comments

Leave a Reply