4 Replies Latest reply on Aug 27, 2014 9:12 PM by WF7A

    A little problem with the Set Selection script step

    WF7A

      Title

      A little problem with the Set Selection script step

      Post

           This is curious so I need a little guidance why what I'm trying to do isn't working in a tabbed layout:

           I'm using the script step as follows:

           Set Selection [RESUME_PARENT:ResumeEdited2__lxt; Start Position: 0; End Position: 0]

           ...so the cursor enters the ResumeEdited2__lxt text field and places itself before the first character entered in the field. Works fine if the field is "flat" on a layout.

           However...

           It doesn't work when that same field is in a tabbed layout. I tried inserting the Go to Object script step before the aforementioned script step to help better define the field for FileMaker to find, but no dice. So, is there something special I need to know so I can have the cursor end up before the first character in a field in a tabbed layout or have I finally lost my last remaining brain cell? (Actually, that would explain the burning smell around here.)  TIA for your help!

        • 1. Re: A little problem with the Set Selection script step
          raybaudi

               If you named the field, the steps are:

          Go to Object [ Object name: "YourObjectName" ]
               Set Selection [
          no field name here ; Start Position: 1; no end position here]

          • 2. Re: A little problem with the Set Selection script step
            WF7A

                 Thanks, Ray. I tried your suggest and the cursor goes to the field just fine but positions itself at the end of the text, not at the beginning, so I'll play with it some more later today. (I'd upload the file but since it's proprietary it's verboten for me to do so.)

                 It doesn't make a difference whether the field is enabled for scrolling or not, so that's not a variable. 

            • 3. Re: A little problem with the Set Selection script step
              philmodjunk

                   Set Selection [RESUME_PARENT:ResumeEdited2__lxt; Start Position: 0; End Position: 0]

                   Should successfully put the cursor at the start of the text in the field, but since it's in a tab control, you may need to pop the panel that contains this field to the front first.

                   Using Raybaudi's method should achieve that result as putting the focus on a field in the tab control will pop that panel to the front.

                   But using go to object and specifying the object name of the tab panel (Has to be named in the inspector), and then using your original set selection script step should succeed in doing this as well.

                   You aren't trying to do this via a Web Browser to a Web Direct published database are you? (There's a known limitation there that might be a factor.)

              • 4. Re: A little problem with the Set Selection script step
                WF7A

                     Thanks for jumping in Phil. No, it's not through a web browser or Web Direct.

                     Found the problem: *blush*  A subsequent script step nulled the Set Selection operation so that's why it wouldn't work on the tabbed layout after I followed Ray's spot-on advice.

                     Moron of the story: Re-check what happens downstream since it sure affects what happens upstream!