FileMaker Weetbicks

Putting One Object Into Multiple Tabs

September 1, 2010 By Daniel

Here is a nice quick technique that will allow you to place a layout object or objects into more than one tab on any given tab control object.


The Problem

With tab control objects, when you place an object inside a tab, then that object is now enclosed within that tab. Switching to a different tab will effectively hide the object, because being on the other tab it is no longer visible.


The Reason

Sometimes however, you may have a layout object or objects which you wish to remain consistent across multiple tabs. It could be a portal, web viewer, text label, or series of fields.

The first solution that might come to mind would be to make copies of the layout object(s) and place them into each individual tab control object, there are some downsides to this method:

• Having copies means any change you need to make to one object, you must repeat changes to all.
• Being unique layout objects, if you are naming objects for various purposes (ie scripting navigation), then each object requires it's own name, adding some complexity to navigation to the object.
• In the case of portals, being different objects means each will have their own scroll bar position, switching tabs may yield a different set of visible records in the portal if the scroll positions are different.
• Web viewers will load when first viewed, so when changing tabs you will have each web viewer loading itself, rather than loading once for all tabs.
• and so on....


The Solution

The solution to this issue lies in the rules surrounding when a layout object is considered "in" a tab control object, and when it is not. Basically, a layout object is considered outside of a tab if it's top coordinate lies outside of the tab.

Note that a tab actually encompasses part of it's tab label area as well as the inner tab section (see photo).

A basic tab control object

So, the goal is to somehow get the top coordinate of the layout object(s) positioned so that it lies outside of the tab control object


The Method

To do this, first start with the layout object you wish to place in each tab control, positioned outside of the tab object iself. In this example, I will be using a green circle object.

An object outside the tab

Next, create another layout object and place this directly above the other object, place it so that it lies above the tab control object.

Two objects, both outside tab, but one above the tab

For the sake of this example I have made the second object a green square. Note that this second object should be a very simple INVISIBLE object - a text label which is just a space, or a transparent no-line rectange, or even a 0pt line would all be acceptable.

Next, you want to select both objects and group them using the group command - Arrange -> Group.

The two objects are now grouped

The reason why this is all done outside of the tab control object is that FileMaker will not allow you to group objects that are both inside and outside of a tab control object, it's either all in or all out.

However, once grouped, you can place half the grouped object in the tab control, and half out, and this is what we will be doing.

The object now lies part in/part out, but is actually out

With the grouped object placed in the correct position, it now appears as if the circle is in the first tab. Changing tabs will show the circle apparently in every tab. In actuality, the layout object - which is now the grouped object - is outside of all tab control objects. The rule in FileMaker is that if a layout object is both in and out of a tab control object, it will appear in front of any other object within the tab. The circle is basically in front of the tab control object in terms of layout ordering, and so appears in front of every tab.


Final Thoughts…
This technique is great, and I use it all the time. You can use the same idea to produce fields/labels that appear beside tab names - rather than have to put the fields into every tab, group them with a single object above the tab control to keep them visible no matter what tab you have selected.

Cheers.

Comments

David Zakary

02 January, 2011

Neat trick. Usually I'm trying to do the opposite - make sure everything is inside the tab so that it isn't a "global" element. Now I have a reason to use it.

Jack Rodgers

05 January, 2011

Nice Catch!

How many times have we had the errant field showing up in all tabs yet failed to make this connection...

panos

15 July, 2011

Great tip, I sometimes use it myself. Needs to be reminded though that caution must be exercised if during development objects are ungrouped to performed any modification to either of them. Grouping must be restore, otherwise the inside-the-tab-panel object will appear only in one tab.

Something to say?

Question: A powerful script step is "go to record"

Some HTML is OK

  • <b>bold</b>
  • <i>italic</i>
  • <blockquote>
    blockquote
    </blockquote>
  • <pre>
    preformatted code
    </pre>