3 Replies Latest reply on Aug 27, 2013 12:41 PM by DavidJondreau

    On Tab Switch Behavior

    CCAS

      Is it possible to structure a script, and FM12 in general, such that a tab is activated only when it is actually clicked (or tapped) on. The problem I'm having with the script trigger for OnTabSwitch is that when sub-scripts on a tab panel are called there are numerous activations of the OnTabSwitchtrigger (generating unnecessary overhead and often times unwanted behavior) ?

        • 1. Re: On Tab Switch Behavior
          DavidJondreau

          I recommend switching to a new layout with no triggers, in fact nothing at all, on it to avoid this.

           

          You can also add an If condition at the beginning of all your triggered scripts. If a variable is set, say $$triggers.off = 1, then Exit Script[]. Then set $$triggers.off = 1 at the start and clear it at the end of the script.

           

          Why are you navigating between tabs during a script? Usually it's unnecessary.

           

          DJ

          • 2. Re: On Tab Switch Behavior
            CCAS

            Thanks…

             

            As it is, the point is that I am not navigating between tabs during scripts run from a given tab panel. It appears that any action in a script that resets focus - to anything - results in the triggering of OnTabSwitch.

             

            There are instances where necessary and appropriate scripts on a tab panel do their work on layouts that do not contain tabs or tab panels and this almost always - and for reasons not altogether clear - causes yet another iteration through the script associated with the OnTabSwitch event…There are even cases where the "CurrentTabPanel" returned is incorrect, resulting in totally anomalous behavior.

             

            In short, I'm totally unclear on just what triggers the OnTabSwitch script, or the characteristics of triggering events. These events should be precise enough in their definition that there is no doubt whatsoever as to how to employ events for a desired result.

             

             

            Nick Kasun

            Spotsylvania, VA

            • 3. Re: On Tab Switch Behavior
              DavidJondreau

              Posting copies of your scripts, and even better, your file would help a lot.