4 Replies Latest reply on Jan 29, 2015 3:31 PM by MorkAfur

    Getting Active Tab

    MorkAfur

      Title

      Getting Active Tab

      Post

      Trying to get the active Tab, so you can run code before that tab loads (like a "click" event, which I wished we had), using this technique as recommended by David Jondreau, did not work for me:

       GetLayoutObjectAttribute ( "Renewals" ; "IsFrontTabPanel" ).

      Although I created a Name = "Renewals" in the inspector and added the script to the onPanelSwitch Event, the script does not fire as the "Renewals" tab loads. Instead, the script runs as I click another tab and at that point FMP realizes, ahh, the "Renewals" tab is front.

      However, this behavior doesn't help me at all if I want to prepare a tab before the user sees it.

      ---

      This is a follow up to an earlier posting (http://forums.filemaker.com/posts/379a1f9fa0) where Phil suggested using:

      Get ( TriggerTargetPanel )

      (This is also a slightly different situation than the posting referenced above.)

      This works as expected!!!!

      ---

      Excellent again, Phil. :)

      - m

        • 1. Re: Getting Active Tab
          philmodjunk

          Is there a question in all of that?

          The first suggestion works from the OnObjectModify trigger while the second works from the OnPanelSwitch trigger (name is different in version 12).

          OnObjectModify performs the script AFTER the triggering event (the change in panels) is processed by FileMaker. The OnPanelSwitch trigger performs a script BEFORE the triggering event is processed. You can even use Exit Script [False] to keep the clicked panel from ever becoming the front tab (or slide control) panel if you want.

          The first method was our only option in FileMaker 11. The second was added in version 12, renamed and extended to slide controls in Version 13.

          Note that all script triggers can be classifed as either "after the event" or "before the event" triggers. All "before" triggers can perform a script that uses Exit Script [False] to keep the triggering event from being processed. See "setting up script triggers" for a table that lists all triggers and identifies which are "before" triggers and which are "after".

          • 2. Re: Getting Active Tab
            MorkAfur

            Nope, sorry. I thought I had a point, but now that I read my posting again, perhaps I was rambling...

            I abandoned the tab since I wanted to display a listing report on another of the tabs, but couldn't adjust the window so it wouldn't also affect the other tabs (by design, I'm sure). The grid view is ugly so I wanted to be able to list the matching records from a find in a nice layout.

            The other $%(!!*(&$(%&* thing I did was mistakenly created a date field as a text field. Then spent several hours trying to understand why my date calculations were always off. Jeeez!

            Rambling again? Maybe. It's been a long day.

            It's all good now!

            Appreciate your reply anyway, Phil. :)

            - m

            • 3. Re: Getting Active Tab
              philmodjunk

              For listing data From a found set in a report, use List View not Table View.

              • 4. Re: Getting Active Tab
                MorkAfur

                Hey Phil,

                I don't use a report per se, it's a layout with a script that figures out what records to show based on the next payment date.  That's probably what you meant.

                So yup, I used the list view. The tab control wasn't a good choice for a list view report since compressing the vertical space on one tab messes up each of the other tabs.

                It's all good.

                -- m