14 Replies Latest reply on Jun 20, 2017 1:57 PM by TSGal

    Set Selection script step does not work in WebDirect

    oesupport

      Summary

      Set Selection script step does not work in WebDirect

      Product

      FileMaker Server

      Version

      13v2

      Description of the issue

      Using the Set Selection script step does not work in WebDirect. It will go to the specified field, but only places the cursor at the end of the existing text.

      I have tried it on Safari, Chrome for Mac, and Chrome for Windows.

        • 1. Re: Set Selection script step does not work in WebDirect
          TSGal

               Nick_M:

               Thank you for your post.

               I am partially able to replicate the issue.  This is what I have done.

               1. Using FileMaker Pro 13.0v3 to access the FMServer_Sample.fmp12 file on FileMaker Server 13.0v2, I lacerated a new table "TEST" with the following two Text fields:
                  Text1
                  Text2

               2. Into Text1, I enter the string:   ABCDEFGHIJKLMNOP

               3. I created a script "SetSelection" with the following steps:
                  Go to Layout [ "TEST" (TEST) ]
                  Enter Browse Mode
                  Set Selection [ TEST::Text1 ; Start Position: 3 ; End Position: 7 ]
                  Copy []
                  Go to Field [ Select/perform ; TEST::Text2 ]
                  Paste []

               4. I execute the script, and Text2 contains "CDEFG" as expected.  I then clear the contents from Text2.

               5. On Mac OS X 10.9.3, I launch Safari 7.0.3 and access the hosted FMServer_Sample.fmp12 file.  I execute the script, and "CDEFG" is displayed properly in Text2.

               6. On Windows 7, I launch Chrome 34, access the hosted file, execute the script, and this works as expected.

               7. Since you mentioned the text isn't selected, I inserted a "Pause/Resume Script [ Duration (seconds): 3 ]" just after Set Selection.

               8. I executed the script on the Windows machine, and the text is highlighted in Text1 for 3 seconds..

               9. I executed the script on the Mac OS X 10.9.3 machine, and the text is highlighted for 3 seconds.

               10. I went to Mac OS X 10.8.5 machine, launched Safari, accessed the file, executed the script, and the text was NOT highlighted.  I launched Chrome on the same machine, and the text was NOT highlighted.  However, in both cases, after 3 seconds, the "CDEFG" does appear in Text2.

               11. Just to be sure, on the same machine, I executed the script again, and the text is now highlighted.  Both for Safari and Chrome.

               This issue appears to occur only on the first instance.  All subsequent instances it works correctly.  Can you confirm?

               What is your goal with the Set Selection?  Perhaps there is a workaround.

               Regardless, I have forwarded your post along with my findings to our Development and Testing departments for review.  When I receive any feedback, I will let you know.

               TSGal
               FileMaker, Inc.

          • 2. Re: Set Selection script step does not work in WebDirect
            oesupport

                 The script step Set Selection is used quite often to place the cursor into a specific location in a field before a user types into said field.

                 Example is if you have an internal messaging system in your solution for users to send messages to one another. When they reply to a message and you want to have the original message quoted beneath the new message.

                 To do this you would set the field where they write the message with a few carriage returns and then the original message. Then you would use Set Selection to place the cursor at the beginning of the field where they write their message.

                 The way you use Set Selection in this example to to set the start position to 0 and the end position to 0. This does not work in WebDirect.

            • 3. Re: Set Selection script step does not work in WebDirect
              TSGal

                   Nick_M:

                   Thank you for the additional information.

                   First, our Testing and Development departments are already aware of this issue, and your post has been linked to the original report.

                   With the information you gave me, since this appears to be a timing issue, I found that if I Set Selection to another set of text, paused 0.5 seconds and then Set Selection to the desired location, it works in WebDirect.  Using my example:

                      Set Selection [ SetSelection TEST::Text1 ; Start Position: 1 ; End Position: 1 ]
                      Pause/Resume Script [ Duration (seconds): 0.5 ]
                      Set Selection [ SetSelection TEST::Text1 ; Start Position: 1 ; End Position: 0 ]

                   I tested this with Safari and Chrome on two different Macs.  My Windows machine is currently unavailable for testing.

                   TSGal
                   FileMaker, Inc.

              • 4. Re: Set Selection script step does not work in WebDirect
                philmodjunk

                     An entry in the Known Bugs List has been linked to this Issue Report. Any Comments/Questions/Suggested Corrections should be posted here or in a new thread. Please do not post such comments to the Known Bugs List thread.

                • 5. Re: Set Selection script step does not work in WebDirect
                  Fred(CH)

                       Today, this bug has been reported one more time bug noticed by 3 developers FMPug WebDirect issue by another member.

                  • 6. Re: Set Selection script step does not work in WebDirect
                    TSGal

                         Fred:

                         Thank you for notifying me of the other post.  I have responded.

                         TSGal
                         FileMaker, Inc.

                    • 7. Re: Set Selection script step does not work in WebDirect
                      dataexperience

                           I have tried the recommended delay, prefaced by a Set Selection statement to another part of the text, following the delay with the correct Selection section. Nothing I try works. I have this built into a routine that substitutes text from one field to another and it all works perfectly in FileMaker Pro 13.0v3. I am working with FileMaker Server 13.0v2 on an iMac, running Mavericks, with 32 GB of RAM, the fastest i7 quad processor, and solid state drive.

                           I am accessing with FileMaker Pro Advanced 13.0v3 on Mac and Windows 7 Professional, and everything works fine. I then attempt the same actions in WebDirect, from the same machines described above, with the latest installs of Google Chrome, Firefox, Internet Explorer 11, and Safari. The routine sends the cursor goes to the end of the field in every case with WebDirect.

                           I note that "Get ( ActiveSelectionSize)" is not supported in WebDirect, so I have abandoned attempting to highlight a given selection. I would be happy to get the cursor in at the selected Set Selection Start Position ( and perhaps at the end of the inserted text, which would be Set Selection Start Position + character count).

                      • 8. Re: Set Selection script step does not work in WebDirect
                        TSGal

                             John Howell:

                             Thank you for your post.

                             The Set Selection script step currently does not work reliably in WebDirect, even with the Pause/Resume script step.  My example above now fails for me under another file, so there are some other factors at play.

                             I have attached your post to the original report.  When more information becomes available, I will let you know.

                             TSGal
                             FileMaker, Inc.

                        • 9. Re: Set Selection script step does not work in WebDirect
                          TSGal

                          All:

                          This issue has been fixed in FileMaker Server 14.0.1.

                          TSGal
                          FileMaker, Inc.

                          • 10. Re: Set Selection script step does not work in WebDirect
                            jdevans

                            My script attempts to place the cursor back at the end of whatever the user typed into a "search" field after doing a commit records step. In WebDirect, after what appears to be about a 0.125 sec delay, it puts the cursor back at the BEGINNING instead.
                            I'm using a "filter-as-you-type" script along with a filtered portal. It works great in the FM Pro client, but maddening in WebDirect. The 125mS (or so) delay or so has the effect of, lets say you type "ma" into the search field, and wait a second before typing "ry" (intending to type "mary"). The delay, puts the cursor back at the beginning of the field after typing the first two characters, and the result is "ryma"

                            It does this after each character is typed (puts the cursor back at position 0 instead of at $cursorpos.

                            Here's my script: executed onObjectModify

                             

                            Set Variable [ $cursorpos; Value:Get ( ActiveSelectionStart ) ]

                            Commit Records/Requests

                            [ No dialog ]

                            Refresh Portal [ Object Name: "fab.steps.portal" ]

                            Set Selection [ Fab_Ops_F::x_fabstep_search; Start Position$cursorpos; End Position0 ]

                             

                            Does this differ enough from the original post to have a different solution? Or is this more of the same? BTW, I'm running FMPro 15.0.3.305, and FM_Server 15.0.3.308

                            • 11. Re: Set Selection script step does not work in WebDirect
                              user19745

                              HI TSGal

                              Please Filemaker !

                               

                              Please Filemaker Fix this problem we have this problem again in Filemaker 16

                              it has been 4 Years with this problem and its a very important option for WebDirect.

                               

                              Walter Noia

                              • 12. Re: Set Selection script step does not work in WebDirect
                                TSGal

                                jdevans:

                                 

                                I am able to replicate this issue with FileMaker Server 15 and FileMaker Server 16 (slightly different results).  Under FileMaker Server 16, I only return to the beginning if I delete a character.  Otherwise, the Get ( ActiveSelectionStart ) returns the value prior to the modification in WebDirect.  That is, when I type "Mary", I get "yraM".  If I already have "Mary" in the field and start typing "Mary" again, I get "MaryyraM".

                                 

                                All of this information has been forwarded to our Development and Testing departments for review.  When I receive any feedback, I will let you know.

                                 

                                TSGal

                                FileMaker, Inc.

                                • 13. Re: Set Selection script step does not work in WebDirect
                                  jdevans

                                  Thanks so very much for keeping me in the loop on this.

                                   

                                  Dave Evans

                                  • 14. Re: Set Selection script step does not work in WebDirect
                                    TSGal

                                    jdevans:

                                     

                                    Development and Testing informed me that the latency and asynchronous of WebDirect with script triggers makes it difficult to coordinate between the server and client.  A timer that expects the correct selection start value cannot be accurate with the current WebDirect 16 architecture.

                                     

                                    TSGal

                                    FileMaker, Inc.

                                    3 of 3 people found this helpful