9 Replies Latest reply on Nov 29, 2016 10:04 AM by MikeCrumley

    Sticky Portal Scrolling?


      Hello all!


      So I have a small issue that doesn't really effect usability, it's just an annoyance. In FMP15 Advanced, I have a portal showing records that are buttons. The scrollbar is enabled, to accommodate a changing quantity of records shown in the portal. When I scroll down and click one of the records not shown when the scrollbar is at the top, it goes to the record that I clicked, but the scrollbar goes back to the top of the portal. Is there a way to make the scrollbar stay where I left it? Any help would be beneficial! Thank you!

        • 1. Re: Sticky Portal Scrolling?
          it goes to the record that I clicked,

          By what method do you do that? Are you sticking to one layout and not opening a new window? (Go to Related Records can do it either way).


          If so, this is a problem encountered with that approach that does not occur if you open a new window instead.


          Ir you prefer to keep it in one window, Set a variable to Get ( ActivePortalRowNumber ) before pulling up the specified related record on another layout. When the script or user returns, use Go to Object Name to put the focus back on teh correct portal (do this even if you have only one portal, that might change in the future) and use go to Portal row to put the focus back on the clicked portal row. This doesn't restore the portal scroll bar to its exact original position, but it does at least leave the clicked portal row visible.

          • 2. Re: Sticky Portal Scrolling?

            Double-click the portal to enter the Portal Setup dialog. Choose "Allow vertical scrolling", but deselect "Reset scroll bar when exiting record". This will cause the portal to remain in its current position until manually scrolled.


            Screen Shot 2016-11-21 at 5.48.58 PM.png

            • 3. Re: Sticky Portal Scrolling?

              Thank you for the fast reply!


              Clicking the button in the portal navigates the the selected record in the same layout and does not open a new window. I'm trying to implement what you suggested, and I will hit you back if I have any further questions or to let you know the results.

              • 4. Re: Sticky Portal Scrolling?

                "Reset Scroll bar when exiting record" is already unchecked. I've tried checking it as a test and it does the same thing it's always done.

                • 5. Re: Sticky Portal Scrolling?

                  I'm not seeing the behavior you're describing. See attached file. What's different with your implementation?

                  • 6. Re: Sticky Portal Scrolling?

                    What does your script do after it changes layouts?

                    • 7. Re: Sticky Portal Scrolling?

                      Here is the script that runs when the button is clicked:


                      My boss made this script, so I am not 100% sure how he laid out the fine details.

                      • 8. Re: Sticky Portal Scrolling?

                        Well I am now going to criticize your boss's work.


                        Copy/paste should never be used in this fashion to move data from one Filemaker table to another:


                        a) It's "brittle". should the field being copied or the field being pasted be removed from their respective layouts, the script will fail to work and no error message will appear telling you that it didn't work.

                        b) It destroys any data that the user may have copied to the clipboard prior to running this script. This confuses and annoys users when they then paste from the clipboard only to get something copied by your script instead of something that they copied.


                        Use set variable in place of copy. Use Set Field in place of paste to move the data from the variable into the target field.


                        Next, Insert Text is not the best script step to use here. Insert Text is just as "brittle" as Copy and paste and for the same reason. Use Set Field instead of Insert. I only use Insert Text when I want to insert text into a field that already has text and I want to insert text at the cursor's current position inside that field.


                        But none of that specifically affects cursor position, but the layout change does as far as I know. It also does not appear that you've listed the entire script--otherwise this script never returns you to the original layout where you'd see that the portal has "snapped back".


                        Please note that I've previously listed your options for avoiding this.

                        1 of 1 people found this helpful
                        • 9. Re: Sticky Portal Scrolling?

                          I tweaked with the script based on your suggestions, and it seems to have fixed the original problem! Thank you so much!