Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Get(ActiveTab) in FMPro 12

Featured Replies

Have to capture current Layout Name, Table Name and Tab Name.

First two are done by Get ( LayoutTableName ) and Get(LayoutName).

The third, to get current Tab name, should go with Get(TriggerCurrentTabPanel).

Manual says that is has to go along with OnTabSwitch script trigger.

When I try to set OnTabSwitch script trigger, right click on button, it wont allow me to use it.

All other options on trigger menu are available but OnTabSwitch.

I did check are Tabs named properly and it seems ok.

If anyone can help, please welcome.

Best regards

This trigger is only available for a tab control; the FileMaker Help system states that “… OnTabSwitch applies to the entire tab control and not to individual panels.”

What is the purpose? If there is more than one tab control on the layout, how do you know which one you want? Or do you want a list of active tabs?

Set Variable [ $tab; Value:LayoutObjectNames ( Get ( FileName ) ; Get ( LayoutName ) )] Will give you a list of all the objects on a layout.

To get the active tabs I use a loop and GetLayoutObjectAttribute ( LeftValues ( $tabs ; 1 ) ; "isFrontTabPanel" ) = 1 to cull that down to just a list of active tabs

  • Author

Yes indeed, I got 8 Tab panels on one Layout and need to pass to the script just the active one.

At the moment I use Get(ScriptParameter)...but was so in hope that we can do something with Get(TriggerCurrentTabPanel).

I lookied into it a bit and can't really see any way to capture the object name of the current "Active" tab. If you have one Tab control with 8 tabs then you could probably use the technique I mentioned above. OnTabSwith fire a script that loops through the list of layout objects and use the GetLayoutObjectAttribute ( LeftValues ( $tabs ; 1 ) ; "isFrontTabPanel" ) to pull out the active tab. But if you have multiple tab controls on thelayout you will get a list of front tabs.

If I were trying to do this and wanted to grab the object name of the active tab when I click on it. I would probably replace the tabs with buttons that call a script. You would give each tab an object name and pass it using a script parameter. The script would be simply;

Set Variable [ $$activeTab; Value;Get ( ScriptParameter ) ]

Go To Object [ $$activeTab ]

You can use the OnTabSwitch trigger to run a basic script that sets a variable.

SetVariable [ $$tabselected; Get(TriggerTargetTabPanel) ]

Get(TriggerTargetTabPanel)

Aha, I missed that one :)

  • Author

Ron, thank you so much for your help.

Seems as GetLayoutObjectAttribute ( LeftValues ( $tabs ; 1 ) ; "isFrontTabPanel" ) = 1 might bring some result, I'll post here as soon as I make it work in my case.

Mr Vodka, that is what I did try as first and it wont go.

Please explain what you mean. You have to set a variable with the trigger.

  • 8 months later...

Getting in the Way Back Machine here...

 

One critical clarification that I think needs to be made here (and perhaps this is what Mr. Vodka was implying, but it wasn't clear to me):  you need to use these function calls INSIDE the trigger script, NOT as script parameters to the script you are calling on the trigger.  If you use them as script parameters, you will get a result of "0".

 

 

--  J

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.