4 Replies Latest reply on May 28, 2010 7:26 PM by comment_1

    Tabs

    garonson

      Title

      Tabs

      Post

      Is there any way to selectively via script grey-out or disable certain tabs that are not relevant based on a set flag or a test?

        • 1. Re: Tabs
          philmodjunk

          If you manage all the details just right, it can be done, but it takes careful design work and scripting.

           

          1. You have to set your tab labels to zero width and replace them with buttons.
          2. The buttons have to be placed so that at least one pixel row is above the border of the tab control (otherwise all the buttons become part of the first tab.)
          3. Then you can use conditional formatting to change the color of the button and/or it's text to show the user whether or not the tab is accessible.
          4. You also need to give each tab an object name in the Inspector (FMP 11) or Object Info (Filemaker 10 and earlier) palette.
          5. Your buttons can then use a script that checks your flag or other condition to see if the tab should be accessible. If so, it uses go to object to bring up the desired tab. If not, it does nothing.
          • 2. Re: Tabs
            garonson

            Great Idea.  I just found another simple way.  I made two duplicate layouts with some tabs removed from each.  Based on my flag setting I select the correct layout and make sure I am on the same main record.

            • 3. Re: Tabs
              philmodjunk

              Yeah, that works to and is easier to set up as you can duplicate your original layout and then modify the copy to get your second version. It can, however, lead to having a lot of duplicate layouts to maintain if you have a number of different tabs you want to show as "disabled" in certain situations.

               

              As always, there are trade offs.

              • 4. Re: Tabs
                comment_1

                 


                GordonA wrote:

                I made two duplicate layouts with some tabs removed from each.  Based on my flag setting I select the correct layout


                You could also place two tab controls inside a third one, and select the correct one - using only one layout.