3 Replies Latest reply on Jun 15, 2017 5:30 PM by Philip_Jaffe

    Restore Active Tab Panels in Separate Tab Controls

    fmdataweb

      I have a layout which has 2 Tab Controls on it:

       

      Tab Control A

      Tab Control B

       

      Tab Control A has 6 tabs on it, and Tab Control B has 2 tabs on it.

       

      I have a script the processed some related records, so it switches layouts to the related child records then switches back. If I am on tab#4 on Tab Control A and tab#2 on Tab Control B I would like to return to those tabs and not the default tabs for each tab control when I've finished my process and return to the original layout - is there a way to do this?

       

      N.B. Tab Control A and Tab Control B are not nested, they are 2 separate Tab Controls on the same layout independent of each other.

        • 1. Re: Restore Active Tab Panels in Separate Tab Controls
          KenNewell

          Name the individual tabs a unique object name and then at the end of your script have a Go To Object script step that goes to the object.  Since you have two independent tabs the last object you go to should be the tab you want active.  The first go to object step will simply make the tab visible on the first tab control but it will not be active.

           

          Hope that makes sense.

          1 of 1 people found this helpful
          • 2. Re: Restore Active Tab Panels in Separate Tab Controls
            erolst

            Easiest method: process the related records in a new window that you close when done.

             

            Alternatively: give each individual tab a name, and use GetLayoutObjectAttribute ( "isFrontPanel" ; "objectNameInQuotes" )

             

            There is no GetLayoutObjectAttribute ( "nameOfFrontPanel" ; "nameOfTabOrSlideControl" ), so you need to provide a name and perform a test.

             

            Since you're performing a script anyway, you could automate this like so...

             

            Set Variable [ $listOfTabNames ; List ( "nameTab1" ; "nameTab2" /*etc.*/ ) ]

            Loop

              Exit Loop if [ Let ( $i = $i + 1 ; $i > ValueCount ( $listOfTabNames ) ) ]

              Set Variable [ $thisName ; GetValue ( $listOfTabNames ; $i ) ]

              Set Variable [ $listOfActiveTabNames ; List ( $listOfActiveTabNames ; If ( GetLayoutObjectAttribute ( "isFrontPanel" ; $thisName ) ; $thisName ) ) ]

            End Loop

            # [ leave layout, do stuff,; return ]

            Loop

              Exit Loop if [ Let ( $j = $j + 1 ; $j > ValueCount ( $listOfActiveTabNames ) ) ]

              Go to Object [ GetValue ( $listOfActiveTabNames ; $j ) ]

            End Loop

            1 of 1 people found this helpful
            • 3. Re: Restore Active Tab Panels in Separate Tab Controls
              Philip_Jaffe

              Agree with erolst.  Simplest way is to open a new window to process the related records then close that window when done.