Remembering / Restoring Tab Panels Issues
Tab Panels were added to FileMaker Pro in version 8.5, providing a much needed way to be able to store and organize a lot more information on a single layout. But despite all the versions to come after, FileMaker never created a way to automatically restore which tab panel you were on when you navigated to a different layout and back again. FileMaker always resets all the tabs. This can be very frustrating in a fast paced work environment when navigating between layouts.
What is Tab Controls?
Tab Controls is a FileMaker solution I created. It has a pair of scripts that can be implemented as subscripts into your regular layout navigation routines. These scripts remember and restore the front tabs of all tab controls, including nested tabs, when you navigate between different layouts. To implement, all you have to do is copy and paste the scripts from the example file into your solution and then call them as part of your navigation sub-routines. Complete descriptions on how it works are built into the example file. Just download it and check it out for yourself!
I'd like to extend a special thanks to the following for their feedback, suggestions, inspirations, and error catching:
Steve Gerow, Jeremiah Small, Kevin Frank, Ray Cologon, Brian Dunning, Bruce Robertson, Ilyse Kazar, Peter Vinogradov, and Tom Elliott
TC 2.0: for FM 12 +
With the release of FileMaker 14, I felt it was high time to port over the system and make sure everything was working properly. Once I got under the hood, I couldn't stop tinkering. There are enough changes that I felt it was worth releasing as Tab Controls 2.0, dedicated for the FM 12+ family.
2.0 v5: July 31, 2017
- Added one line of code to the Remember Tabs script that inserts a line break after every instance of "<" or ">" in the LayoutObjectNames list. Addresses the issue where the function sometimes returns a list where object names were on the same line as a "<" or ">", or there would be two "<<" or ">>", which caused the script to miscalculate the "tier" an object was on, and not be able to save the tabs lists to the global variable.
- Rather than download a new version, you can fix an existing version by adding the following line of code after line 28:
Set Variable [$LayoutObjectNamesList; Value: Substitute ( $LayoutObjectNamesList ; [ "<" ; "<¶" ] ; [ ">" ; ">¶" ] )]
2.0 v4: June 10, 2016
- Added steps to check to see if parent object of a top tier tab control is a popover while restoring tabs. If so, it will close the popover.
- Added popover example.
- In order for new feature to work, the popover must have an object name like tab controls do.
2.0 v3: May 16, 2016
- Updated for FM 14+ only
- Added new variables to Restore tabs to allow for bypassing of script triggers or skipping restoring tabs all together.
- Added example of how to bypass panel script triggers when restoring tabs.
- Added example of how to disable restoring tabs if not desired.
- Added example of a "vertical" tab panel, with instructions on how to recreate the effect.
2.0: Aug 4, 2015
- Updated for FM 12, 13, and 14 only
- Added tweak to take into account new "IsFrontPanel" for FM 13+ vs. "IsFrontTabPanel" for FM 12
- Revamped demo layout to bring it more up to date aesthetically
- Changed clear lists button to wipe out all tab data, including that being stored in the global fields
- Removed all underscores from variable names
- Added global $$TopMostTabs variable to capture which ever top most tabs were actually visible.
- Revised scripting at tail end of "Remember Tabs" script to fix an extremely rare bug that only impacted the ability to accurately capture which front tab panels were vactually visible. Unless you had an extremely complex tab control layout and needed to capture that information, it probably did not affect you. The core remember/restore tabs features were unaffected by this bug.
- Revamped the entire layout, tab orders, as well as documentation / notes on the tabs and scripts.
TC 1.0: for FM 8.5 - FM 11
1.0 v11 is the last release for FileMaker versions 8.5 through 11. There will be no further updates.
Tab Controls 1.0 works for FM 11. It also *should* work for versions FM 8.5 through FM 10, I make no guarantees. It's been years since I have used anything earlier than FM 11. Nor am I willing to support those versions.
1.0 v11: July 22, 2009
- Squashed a minor bug created by v10 changes. This first time the Remember Tabs script was run on any given layout, it would return the incorrect top most tabs, but thereafter, it would work correctly. This bug has been fixed.
1.0 v10: Nov 5, 2008
- Folded in sub-script that captures top most tab into Remember Tabs script.
- Added a script header with the remember tabs script to provide example of new documentation / revision tracking for scripts.
- Added new loop so that the first time the remember tabs script is run on a layout, the list of tab names is calculated and stored before checking against it to see which tabs are the front most. Once the list is generated, the script will not have to recreate it for that layout. This provides a slight boost in performance, since the first part of the script only runs once per layout per user session.
- Simplified "Remember Tabs w/ Fields" script so that it runs the "Remember Tabs" script, and then populates the global fields with the sample data so that you can see the results of the scripts and judge for yourself.
1.0 v8 ~ v9: Sept 3, 2008
- Fixed error in new Topmost Tabs sub-script that in some complex tab control scenarios, failed to capture the correct top tabs.
- Added an optional subscript that allows you to capture the very top-most tab within a given set of tab controls, called from the Remember Tabs script.
1.0 v1 ~ v7: Aug 20, 2008
- Overhauled entire structure of both scripts. Still no requirements for any additional fields, sub-scripts or custom functions.
- "Remember" script now calculates which "tier" a tab control panel is on, where a nested tab control is considered to be on a lower tier than the parent. It then finds all the tab panels that are "front" tabs. It then separates out all of the front tabs into their separate tiers, and concatenates all the tiers into a global string, starting from the lowest tier to the top most tier.
- "Restore" script then goes to each saved front tab object, starting with the lowest tiers first, on upwards.
- In previous versions, Tab Memory merely restored the front tabs in the order that they were listed via the "LayoutObjectNames" function. This sometimes caused errors with very complex nested tab controls that were three or more layers deep.
- Fixed a bug where it was incorrectly marking some nested tabs as being a top tab if the name of the parent tab was a partial match to a value in the top tabs list. That has been corrected. Only exact matches will make it to the second round.
- Fixed the order in which the tabs were restored, as well as removing some uneccesary code.
- Initial release