Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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 ]

Posted

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

SetVariable [ $$tabselected; Get(TriggerTargetTabPanel) ]

Posted

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.

Posted

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

  • 8 months later...
Posted

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

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