3 Replies Latest reply on Feb 6, 2017 7:35 PM by JackRodges

    Simulating html anchor tags

    jpmacdev43

      I'm creating an iPhone solution for a client where a single record consists of a long, scrolling layout. There are various sub-headings (similar to a wikipedia entry) that my client would like to jump to instantly to enter data in that section.

       

      I created a pop-up button in the bottom nav bar which lists all the sub-headings and go-to-object scripts for each pointing to named "dummy" buttons hidden on each sub-section's text header bar. Everything works as expected except that when the go-to-object script runs, the sub-section appears at a random point, often right in the middle or at the bottom of the iphone's screen.

       

      Is there a way to force the scrolling of this very tall layout so that the button object (and its sub-section) appears at the top of the screen?

        • 1. Re: Simulating html anchor tags
          Jason Wood

          When you use "Go to Object", you are scrolling just enough to bring the object into full view, so the scroll position depends on whether you started above or below the object, and whether it was already in view.

           

          You can solve this by making the object exactly the height of the iphone screen (minus any toolbars or navigation parts). To support different devices and orientations, you'd need different objects for each device.

           

          Alternatively, you could use "Go to object" twice - once to reposition below the object (down at least the height of your largest screen), then again to slide back up - but the user is going to see both of those steps. In my testing, you have to put a pause of at least 0.05 seconds between the steps or the first one is simply ignored on iOS (FMGo15). That number might depend on the performance of the device. On my Mac (FMPA14), it follows both steps even if the pause is 0.00001 (but like iOS, it ignores the first go to object if there is no pause at all).

          • 2. Re: Simulating html anchor tags
            jpmacdev43

            A combination of your two suggestions was the perfect workaround for this.

             

            I made the invisible button the height of my screen, added a pause in the script after the "Go to Object" step (.05 seconds) and then a "Commit Records/Requests" to effectively "deselect" the button.

             

            Thank you!

            • 3. Re: Simulating html anchor tags
              JackRodges

              Based on the response above, there is an excellent option here. The typical first response is to name the field as the object since that is where you want to go. But what if you name something other than the field as the object and use that to position your screen.

               

              First thought, place a line object just above your field and then go to that line, You might be able to solve the above/below problem by putting the object in the middle of the field.

               

              FileMaker field handling is a bit unsophisticated and is probably due to using so much third party software such as Java. One would expect that Go to Object would position that object upper right hand corner at a certain upper right hand corner point of your screen, right?

               

              But if the responder is correct in that the object may show up at the bottom or top of the screen rather than at a fixed, reliable point, then that points to sloppiness in engineering.

               

              I've used databases where you can designate the exact point on screen and this is what graphic software does when you move an object on screen.

               

              Try putting a named object behind your field and then moving that about to see how Filemaker responds to its location.