1 2 Previous Next 20 Replies Latest reply on Sep 1, 2016 10:21 AM by GAmstutz

    Stop Portal Scrolling

    DianeJohnson

      Title

      Stop Portal Scrolling

      Post

      I have a layout with employee information. In that same layout I have a portal based on a self-join relationship with just the employee name. I added the action to go to the related record when a name is selected in the portal list. If I scroll down the portal list and choose a name that is not visible in the layout when record 1 is selected, then select that record, the layout then displays the correct record, but automatically scrolls back to having record 1 displayed. I have turned off any and all sort options in the portal setup as well as the relationship definitions, but cannot figure out a way to stop the portal from scrolling once a record is selected in the portal. Is there a way to stop the portal from scrolling back to the top, or does someone have a quick and easy script to take the portal back to the displayed record?

        • 1. Re: Stop Portal Scrolling
          philmodjunk

          It's not perfect but these scripts might resolve the issue for you:

          Set Variable [$$Row ; Get ( ActivePortalRowNumber ) ]
          Go To Related Records [//put your settings here

          Then use a script to return includes this step:

          Go To Object ["PortalObjectName"]
          Go To Portal Row [$$Row ]

          To give your portal an object name, select it while in layout mode and enter a name in the Name box at the top of the Inspectors Postion Tab.

          Note: If you have only one portal on your layout, the object name and Go TO Object are not strictly needed, but it's good practice to do it anyway so that if you later add a different portal to the same layout, your layout change won't break your script.

          • 2. Re: Stop Portal Scrolling
            DianeJohnson

            I haven't tried it yet, but the logic makes sense. I am still learning!!! Thank you. I will let you know if it works.

            • 3. Re: Stop Portal Scrolling
              deliciousapple

              Hi PhilModJunk,

              I tried your technique and it works!  However it would be nice if the portal rows would stay in place.  Anyway to keep the portal from moving?

              • 4. Re: Stop Portal Scrolling
                philmodjunk

                In portal setup... have you selected the "reset scroll bar when exiting record" option? If so, clear that option and see if you get the results you need.

                • 5. Re: Stop Portal Scrolling
                  deliciousapple

                  "reset scroll bar when exiting record is unchecked.

                  I have a self-join - Clients to Clients.  In form view I show client detail on the right, with a portal on the left side used for navigation.  When I click the portal record, a script fires that has your script.  What happens is the the portal record clicked, moves to the bottom of the portal, rather then staying put.

                  • 6. Re: Stop Portal Scrolling
                    philmodjunk

                    Sorry, I should have been more clear. I was suggesting you try this option instead of the script unless you had already tried it this way.

                    I think the layout change in your script is resetting the portal's scroll bar and a script to save and reset the current portal row is the best you can do here.

                    • 7. Re: Stop Portal Scrolling
                      deliciousapple

                      Hmm, I don't quite get what you're saying.  "I was suggesting you try this option instead of the script"  The script I am using is the two scripts you suggested to Diane Johnson.  Diane is having the same problem I am having.  Maybe I should ask how you are implementing your scripts?  

                      I have put the scripts below into one script that fires when I click the portal record, should they be in two?

                      Set Variable [$$Row ; Get ( ActivePortalRowNumber ) ]
                      Go To Related Records [//put your settings here

                      Go To Object ["PortalObjectName"]

                      Go To Portal Row [$$Row ]

                      • 8. Re: Stop Portal Scrolling
                        philmodjunk

                        Never mind the suggestion. It won't apply if you are changing layouts. This setting can keep the scroll bar in place if you scroll the portal, then interact with other parts of the same layout, but I believe changing layouts and returning will still reset the scroll bar on you--hence the scripted approach to reselect the current scroll bar--not perfect as I've already said. You can't precisely reposition the scrolled portal rows.

                        • 9. Re: Stop Portal Scrolling
                          deliciousapple

                          I was hoping for some of your blade runner magic.  I've heard of some techniques to accomplish the repositioning of the scrollbar after enacting the GTTR, however, I've never seen a script..

                          Could there be some way to identify portal row location via calculating total record rows, last record showing and selected portal row, or some other voodoo...

                          • 10. Re: Stop Portal Scrolling
                            DianeJohnson

                            Yes, Phil, I too have the same actions. I do not have have the "Reset scroll bar when exiting record" checked. When clicking in the portal row on the left, invoking the script you suggested, it will go to the related record, but then scrolls the portal so the record you are on is still in the window on the left, but it scrolls the portal so that records is at the bottom of the window. I would love it if Matt Petrowsky chimed in, because he might know the answer. I am using one of the layouts I purchased from him in Theme Studio. Maybe he knows the answer.

                            • 11. Re: Stop Portal Scrolling
                              philmodjunk

                              As far as I know, there is no way to determine the "last record showing" and this then creates the problem here. The alternative may be to avoid changing layouts like this in the script. I wonder if you can use new window with a hidden window to do the "other layout" stuff without seeing the portal reset.

                              Note: This will likely not work well if you are a windows user with maximized windows as you exchange the portal scroll reset for a window resize issue.Frown

                              • 13. Re: Stop Portal Scrolling
                                DianeJohnson

                                I am not changing layouts. The portal is on the left side of the layout, with only the name field in the portal. When you select one of the names, in the right part of the layout, it will display the related record (self joined) with all of the records fields. Does that make sense?

                                • 14. Re: Stop Portal Scrolling
                                  philmodjunk

                                  What method does your script use to pull up the selected record's data on this "right part of the layout"? (There are at least two distinct methods for that and I don't want to assume something incorrectly here.)

                                  1 2 Previous Next