7 Replies Latest reply on Dec 21, 2014 5:24 PM by BrentJohnson

    Tab Control Scripts

    obidon

      Title

      Tab Control Scripts

      Post

           Can somebody give me a few pointers please.  

           I have nested tabs, lets call them level 1 and 2.  Each tab has a unique name and I can use the script step to go to a specific tab.  

           I want a script to obtain the current active tab name .  I`d like to set this as a global variable when a tab is activated.

           Regards

        • 1. Re: Tab Control Scripts
          philmodjunk

               The script steps needed depend on the version of FileMaker that you have. FileMaker 12 added new script triggers specifically for this purpose so the scripting is much simpler in that version.

               In older versions, you can use the OnObjectModify trigger in conjunction with the GetLayoutObjectAttribute function to perform a script that determines which panel of your tab control is the frontpanel in order to put this object name into a global variable.

          • 2. Re: Tab Control Scripts
            obidon

                 I'm using 12a

            • 3. Re: Tab Control Scripts
              philmodjunk

                   Then you have a new script trigger: OnTabSwitch that can use a newly added get function to capture the name of the tab panel that pops to the front when the trigger is tripped:

                   Set Variable [$$Tab ; Value: GetValue ( Get ( TriggerTargetTabPanel  ) ; 2 ) ]

                   and now you can use this step:

                   Go To Object [ $$Tab ]

                   to return that tab panel to the front of the tab control.

                   Note that with nested tab controls, you'll need to set up this trigger to perform this script on each tab control.

              • 4. Re: Tab Control Scripts
                BrentJohnson

                PhilMod,

                I am trying to create a script as you mentioned above, however I am getting the following error message.

                • 5. Re: Tab Control Scripts
                  BrentJohnson

                  Sorry, my attachment was not sent.  See new attached file.

                  • 6. Re: Tab Control Scripts
                    BrentJohnson

                    Second attachment.

                    • 7. Re: Tab Control Scripts
                      BrentJohnson

                      PhilMod,

                      I guess i should have been clearer on my previous post:

                      I have a Layout with a Tab Control (Main_Tab_Control) having 5 tab panels.  The first tab panel is used to determine what information is displayed on the following tab panels, based on several drop-down menus.  On the last tab panel I want to nest an additional Tab Control (Sub_Tab_Control).  Based on the information from the the first tab panel, I want this Tab Control to display only tabs that are needed.

                      Ex: on the first tab panel a drop-down menu displays how many floors the building has "1, 2, 3, 4, and so on".  Sub_Tab_Control has 10 tabs for 10 floors.  If 3 is selected, then I want only tabs 1, 2, and 3 displayed.

                      I hope this helps.

                      I am using FM 13Pro Advance.