1 Reply Latest reply on Apr 21, 2014 8:26 AM by philmodjunk

    Auto-Selecting a Portal Row inside of a Slide Control

    AdamQuintero

      Title

      Auto-Selecting a Portal Row inside of a Slide Control

      Post

           I am running the following script at the OnPanelSwitch trigger of a slide control with a portal on "slide 4":

           Freeze Window

                If[PatternCount(Get(TriggerCurrentPanel); "slide 3") > 0]

                     Go to Portal Row [Select;First]

                     Loop

                          Exit Loop If[PortalTable::portalkey = $$portalKey]

                          Go to Portal Row[Select; Next; Exit after last]

                    End Loop

               End If

           I watched each step in the debugger, and the problem I am having is the focus seems to leave the portal right after the script executes it's last step. The correct row is found and selected, but after scripting ends it is no longer selected. Am I using the correct script trigger for this function? No other scripts are executing after this one at the trigger OnPanelSwitch.

        • 1. Re: Auto-Selecting a Portal Row inside of a Slide Control
          philmodjunk

               OnPanelSwitch is a "before the event" trigger. It performs its designated script, then the event that tripped the trigger, selecting the slide 4 panel, is processed and thus the focus is lost.

               You can keep "before" triggers from being messed up by the triggering event if you end your script with:

               Exit Script [False]

               For a list of all script triggers in a table which shows which are "before" and which are "after" the triggering event, see "setting up script triggers" in FileMaker Help.