Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 3513 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a tab control layout object with several tabs. I have a global field entitled "g.active tab". I want to set g.active tab to the name of the active tab of the tab control object. I hope this is clear.

For example, my tab control object has Student Teachers as tab 1 and Methods Courses as tab 2. When the Student Teachers tab is active, I want to g.active tab to hold the value "Student Teachers" (the name of the tab).

Thanks in advance... I hope this can be done!!

Phil Feldman

Posted

FileMaker Pro 8.5 introduced a function for returning all kinds of information about layout objects. The function is called GetLayoutObjectAttribute.

Assuming you have given each tab panel an object name , you can use the "isFrontTabPanel" property with this function to determine if a certain tab panelis the front panel.

Maybe you could the GetLayoutObjectAttribute function to accomplish what you are looking at.

  • 8 years later...
Posted (edited)

Hi,

For any one looking for a different solution I wrote this simple script called "Get Front Tab Panel Value", no plugins, use as standard for any number of tabs, just use Script Trigger with the help of Optional Script Parameter.

The Global Variable "$$Front_TabPanel" holds the Active Tab.

One time Script:

Set Variable [ $Loop_Count; Value:2 ]
Set Variable [ $N_Parameters; Value:GetValue(Get ( ScriptParameter );1) ]

Loop

If [ GetLayoutObjectAttribute ( GetValue( Get( ScriptParameter );$Loop_Count) ; "isFrontTabPanel" ) ]

Set Variable [ $$Front_TabPanel; Value: GetValue( Get( ScriptParameter );$Loop_Count) ]
Exit Script [ ]

End If
Exit Loop If
[ $Loop_Count $N_Parameters + 1 ]

Set Variable [ $Loop_Count; Value:$Loop_Count + 1 ]

End Loop 

 

Two Additional Steps:

1.- On Layout Mode Name each Object Tab using the inspector, (I use the same name on my Tabs).

2.- Set a Script Trigger  "OnObjectModify" to call the above script, Its very important to use the "Optional Script Parameter" like the following Example tabs:

Tab1  Tab2  Tab3  Tab4

 Optional Script Parameter loks like this:

List(4;"Tab1";"Tab2";"Tab3";"Tab4")

(First Parameter will tell Script how many tabs you have)

This way you can use the same Script for all your Tab Control Panels, just set the first "Optional Script Parameter" to the corresponding count of Tabs followed by the corresponding Tab's Names.

Hope this helps anyone;

FY

Edited by fyanesv
Posted

Since now it is 2015, I think you may want to look at the trigger

OnPanelSwitch

and its accompanying functions

Get(TriggerCurrentPanel)
Get(TriggerTargetPanel)

available as of FM12 (though with slightly different names).

Posted

Wow!, Thanks eos, missed those two functions, never mind my script.

This topic is 3513 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.