6 Replies Latest reply on Apr 4, 2014 1:16 AM by davehob

    Portal row position

    davehob

      Is there an easy way to trap the position of a selected portal row - not the ActivePortalRowNumber, but the "scrolled-to" row number? The ActivePortalRowNumber may be 97, but the position within the portal may be 5, i.e. the 5th from the top of the 10 visible rows. It's this value that I need to capture, so that I can put the user back to where they were when they left.

       

      Any help much appreciated.

       

      Dave.

        • 1. Re: Portal row position
          mikewson

          Dave- I think you are out of luck.  You can only capture the ActivePortalRowNumber.

          • 2. Re: Portal row position
            mikebeargie

            context context context... pain in the butt sometime right?

             

            Get(PortalRowNumber) will only ever return a value if a portal row has focus, so you have to put focus on a row to return a value/position.

             

            Now, bypassing a user's normal method of scrolling a portal, which does not focus a row, you can "hide" the scrollbar under an object, and replace it with your own page up/ page down buttons that auto focus to the next "page" of your portal, allowing you to save that "page" to a global variable for later use.

             

            Something like this, assuming you have a 5-row portal:

             

            If [ get(scriptparameter) = "UP" ]

               Go To Portal Row - by calculation = if (Get(ActivePortalRowNumber) = 0 ; 6 ; Get(ActivePortalRowNumber) + 5 )

                Set Variable $$position = Get(ActivePortalRowNumber)

            Else If [ get(scriptparameter) = "DOWN" ]

               Go To Portal Row - by calculation = if (Get(ActivePortalRowNumber) = 0 and Get(ActivePortalRowNumber) > 5 ; 1 ; Get(ActivePortalRowNumber) - 5 )

               Set Variable $$position = Get(ActivePortalRowNumber)

            End If

             

            You can add actions in and such, but that's the basics of how to do that. The key part of course is to hide the scroll bar. If you want to do some creative virtual listing or filtering you could also adjust this to just display straight pagination of the portal, rather than scrolling in the portal.

             

            Good luck!

            1 of 1 people found this helpful
            • 3. Re: Portal row position
              RobWestergaard

              If you have a name assigned to an object on the portal row, you might be able to use the GetLayoutObjectAttribute() calculation using the attributeName "top" and the portalRowNumber to see where the active portal row is scrolled.

              • 4. Re: Portal row position
                davehob

                Mike,

                 

                Thanks very much for this, which is very clear and will be useful.  I must say, I hoped it would be simpler!  I'm reluctant to replace FM's scrollbars with "home-made" UI stuff, but I'll give it a go. 

                 

                Thanks again,

                 

                Dave.

                • 5. Re: Portal row position
                  davehob

                  Sounds interesting, Rob - so use the physical location of the previously selected portal row as the place to return to?  So far, I can't get it to work - I've done GetLayoutObjectAttribute ( "highlight_bar" ; "top"; Get(ActivePortalRowNumber) ) (where highlight_bar is the name of an object in the row), and it's not returning a value.  I must be doing something wrong, so I'll keep trying.

                   

                  Thanks for your input,

                   

                  Dave.

                  • 6. Re: Portal row position
                    davehob

                    Get (ActivePortalRow'sPositionWithinTheDisplayedRows) - surely it's in there somewhere? Thanks anyway!