Jump to content
Server Maintenance This Week. ×

Get(ActiveTab) in FMPro 12


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

Recommended Posts

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

Link to comment
Share on other sites

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.”

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 ]

Link to comment
Share on other sites

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

SetVariable [ $$tabselected; Get(TriggerTargetTabPanel) ]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 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

Link to comment
Share on other sites

This topic is 4127 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.