7 Replies Latest reply on Oct 29, 2014 6:42 AM by TSGal

    OnObjectModify Script Trigger Loses Focus in Field

    jonro

      Summary

      OnObjectModify Script Trigger Loses Focus in Field

      Product

      FileMaker Pro

      Version

      13

      Operating system version

      OS X 10.10

      Description of the issue

      Certain script triggers, while ostensibly supported in WebDirect, have behaviors that make them unusable. Take OnObjectModify in a field, for example. OnObjectKeystroke is not supported, but if you want to trigger a portal filter based on user input, OnObjectModify is. The problem is that almost anything you do, such as Refresh Window to update a portal causes WebDirect to lose focus from the filter field, and you can’t get it back. I’ve tried Go to Field, Go to Object and Set Selection. None of them will get the cursor back in the field.

      Steps to reproduce the problem

      Should be evident.

      Expected result

      It should work as it does in FMP, where it doesn't lose focus.

      Actual result

      Can only type one character and cursor leaves the field.

      Workaround

      No workaround, have to use script trigger OnExitObject instead.

        • 1. Re: OnObjectModify Script Trigger Loses Focus in Field
          TSGal

          Jon Rosen:

          Thank you for your post.

          Please post your OnObjectKeystroke script, and the field name that is attached to the OnObjectKeystroke script.  This may help determine why the focus is being lost.

          TSGal
          FileMaker, Inc.

          • 2. Re: OnObjectModify Script Trigger Loses Focus in Field
            jonro

            Refresh Window[ Flush cached join results ]

            Refresh Object [ Object Name: "portal help" ]
            Go to Field [ HLP__Help::_Search ]
            // Set Variable [ $Len; Value:Length( HLP__Help::_Search ) + 1 ]
            // Set Selection [ HLP__Help::_Search; Start Position: $Len; End Position: $Len ] 

            • 3. Re: OnObjectModify Script Trigger Loses Focus in Field
              TSGal

              Jon Rosen:

              The "Refresh Window" may take a lot of time, especially if someone else is viewing the record.  Instead, use:

              Commit Records/Requests
              Go to Field [ HLP_Help::_Search ]

              TSGal
              FileMaker, Inc.

              • 4. Re: OnObjectModify Script Trigger Loses Focus in Field
                jonro

                I had tried that already. It didn't work.

                • 5. Re: OnObjectModify Script Trigger Loses Focus in Field
                  TSGal

                  Jon Rosen:

                  Here is what I just did:

                  1. Using FileMaker Pro 13.0v3 under Mac OS X 10.10, I created a new database file (Untitled.fmp12) with 16 Text fields (f1 through f16).

                  2. I created a script, "Test OnModifyObject" with the script steps:
                     Commit Records/Request
                     Go to Field [ Untitled::f7 ]

                  3. In Layout Mode, I selected the field f7, pulled down the Format menu and selected "Set Script Triggers...".

                  4. I entered a checkmark next to OnObjectModify, and selected the script "Test OnModifyObject".

                  5. I went to Browse Mode, created a new record, and entered data into f7.  Works as expected.

                  6. I turned on Network Sharing and Sharing via WebDirect.

                  7. I then uploaded the file to FileMaker Server 13.0v4 running on Mac OS X 10.9.5.

                  8. I first opened the hosted file with FileMaker Pro 13.0v3 to ensure this worked correctly.

                  9. I then launched Safari, and accessed the file via WebDirect.

                  10. In WebDirect, I placed my cursor in f7 and typed "a".  The cursor remains in f7, and I notice the client now has the data plus "a" displayed at the end, so I know the Commit Records is working, plus my cursor is still in the field with WebDirect.

                  What browser are you using?  What is the platform where FileMaker Server 13.0v4 exists?  I'll try and replicate the issue here with your configuration.

                  TSGal
                  FileMaker, Inc.

                  • 6. Re: OnObjectModify Script Trigger Loses Focus in Field
                    jonro

                    This works fine for me on the desktop, but the Go to Field script step fails in WebDirect. The cursor does not return to the global search field. I'm using the latest version of Safari under Yosemite as a browser. The file is hosted by Triple8.net. I don't know what type of server they have, but I'm pretty sure it's some flavor of Windows Server.

                    • 7. Re: OnObjectModify Script Trigger Loses Focus in Field
                      TSGal

                      Jon Rosen:

                      Thank you for the additional information.

                      I uploaded the file to FileMaker Server 13.0v4 running on Windows Server 2008 R2, opened the file with FileMaker Pro 13.0v3 running under Mac OS X 10.10 so I can view the data.  I then launch Safari 8.0 on the same Mac OS X 10.10 machine and access the file via WebDirect.  I put my cursor in the f7 field, type "a", and the cursor stays in the f7 field.  I also notice on the FileMaker Pro 13.0v3 instance that the field now has "a" in f7, so I know the Commit Records step is working.

                      I am happy to send you my test file so you can upload it to your server to test.  Check your Inbox at the top of this page for additional information.

                      TSGal
                      FileMaker, Inc.