4 Replies Latest reply on Aug 6, 2012 6:26 PM by RedL

    Keep on same tab when reenter layout

    RedL

      Title

      Keep on same tab when reenter layout

      Post

      It always go to "Default Fron Tab", set on the tab setting, when reenter to layout.  I need to go to same tab when user was working on before he left the layout.

        • 1. Re: Keep on same tab when reenter layout
          philmodjunk

          Using scripting, script triggers and object names for each panel of your tab control, this can be done, but the steps are much different and simpler if you have FileMaker 12.

          What version of FileMaker are you using?

          • 2. Re: Keep on same tab when reenter layout
            RedL

            I am in FileMaker 11.

             

            What you mean "object names for each panel of your tab control".  I cannot set object name of tab.  Does tab have trigger setting?  I can set script for each field on each tab.  But, there are quite a lots of fields I need to do.

            • 3. Re: Keep on same tab when reenter layout
              philmodjunk

              Enter layout mode.

              Click on the tab control to select it.

              Click it again to select a tab panel. (each tab within a tab control is called a "tab panel" in FileMaker documentation)

              Enter a name for that tab panel in the name box found at the top of the inspector's position tab.

              Repeat for each tab panel where you will need this capability.

              In a script, if you give a tab panel "Data" as the object name, Go to Object ["Data"] will select that tab panel and make it the front panel.

              In FileMaker 11, the trick is to keep track of what tab panel is the front tab panel so a script can reselect it when you return to the layout.

              GetLayoutObjectAttribute can use these same object names to test each tab panel to determine which is the front panel. (FIleMaker 12 offers new triggers and new get functions that make this part much simpler.)

              Say you have two panels with "Data" and "Personal Info" specified as their object names.

              Set up and OnObjectModify trigger on the tab control to perform this script:

              If [ GetLayoutObjectAttribute ( "Data" ; "IsFrontTabPanel" ) ]
                 Set variable [$$CurrentTab ; value ; "Data" ]
              Else If [ GetLayoutObjectAttribute ( "Personal Info" ; "IsFrontTabPanel" ) ]
                 Set Variable [$$CurrentTab ; value: "Personal Info" ]
              End IF

              With that in place to capture the object name of the current tab panel, you can use this one line script to re-select the current tab when returning to the layout:

              Go to object [$$CurrentTab]