1 2 3 Previous Next 35 Replies Latest reply on Dec 19, 2011 5:35 PM by alas

    Portal Scroll Technique needed XPOST

    MicheleOlson

      I am looking for a navigation technique using a portal. I need the portal row that is selected to STICK.

       

      The table is customers with a cartesian join to itself.

       

      The user clicks on a portal row (customer); the row highlights (changes text and background color) and moves to that customer record (GTRR) on the same layout.

       

      All of this works fine.

       

      What doesn't work fine is the highlighted portal row does not stay visible within the portal.

       

      The portal is set to display 24 records and the highlighting concept works fine for the 1- 24, but select record # 33 or #77, etc. and although highlighted, the user can't see that because the portal returns to display records 1-24.

       

      I know there is a technique to accomplish this. Changing the setting for the portal (Reset Scroll Bar When Exiting Record) has no effect: On - nothing. Off - nothing.

       

      I've checked all my resource files and can't find the solution, so I am hoping someone will point me in the correct direction.

       

      I tried searching previous posts for an answer, but frankly the previous posts are not helpful [ not threaded, all attachment examples gone, etc.]

       

      Thanks in advance for any assistance.

       

      Michele

        • 1. Re: Portal Scroll Technique needed [XPOST]
          Bobster

          Hi Michele,

           

          Have you tried saving the Portal Row number to a $var, using Get ( ActivePortalRowNumber )?

           

          Then after the GTRR your next step would be Go To Portal Row by Calculation .

           

          Bob

           

           

          Bob Stuart

          Lord Of The Files

          Think Data Pty Ltd

          Noosa

          Queensland

          Australia.

           

          +61 7 5442 5624

          +61 413 350 993

          • 2. Re: Portal Scroll Technique needed [XPOST]
            Bobster

            That was supposed to read "Then after the GTRR your next step would be Go To Portal Row by Calculation [$var]"

             

            …but "[$var]" got cut off in the posting process.

             

            I hope this new site doesn't repeat the WebCrossing whackiness we came to dislike.

             

            Bob.

            1 of 1 people found this helpful
            • 3. Re: Portal Scroll Technique needed [XPOST]
              MicheleOlson

              Hi Bob,

               

              I am almost there.

              • 4. Re: Portal Scroll Technique needed [XPOST]
                MicheleOlson

                (Bad habit, hitting the save button)

                 

                The script that almost works:

                 

                Set Variable [$active; Get (ActivePortalRowNumber)]

                Go to Related Record [From table: "cus_CUS_all_X"; Using layout: <Current Layout>]

                Go to Portal Row [Select; No dialog; $active ]

                 

                The issues remainiing to deal with:

                1] Without the Select on the GTPR step, the cursor enters a field. Field is set to not enter in Browse, but the script overrides that. (Don't like that)

                 

                2] After the 1st 24 records, the script selects the correct portal row, BUT it is always the bottom row. (Don't like that. Would prefer it was a middle row if it has to be anywhere except where it was originally. [do I need a divide by 24 here to determine the position?? thinking aloud]

                 

                 

                I am working on it an appreciate your replies.

                 

                Michele

                • 5. Re: Portal Scroll Technique needed [XPOST]
                  Bobster

                  Hi Michele,

                   

                  Issue #1

                  You probably want Select as part of the step, because you want the row to highlight. You could put a tiny 1px X 1px dummy field at the top left hand side of the portal for the cursor to go to. Maybe a container field would work well for this, because unlike a text field, it won't try to display a cursor.

                   

                  Issue #2

                  Recalling a similar script I created a couple of weeks ago, I had the script GTPR and then, in a loop with a counter, attempt to go to the Next portal row 12 times (exit loop after last) to force the portal to show more rows.

                   

                  Then the next step had it GTPR back to the row described in the $var. Because it's only 12 rows back, and you are displaying 24 of them in your portal, it should appear centred.

                   

                  Of course, this doesn't work impressively if the row you want to highlight and centre is the Last Record, or among the last few.

                   

                  Bob

                   

                   

                  Bob Stuart

                  Lord Of The Files

                  Think Data Pty Ltd

                  Noosa

                  Queensland

                  Australia.

                   

                  +61 7 5442 5624

                  +61 413 350 993

                  • 6. Re: Portal Scroll Technique needed [XPOST]
                    Bobster

                    Michele,

                     

                    After further thought on the matter of Issue #1, skip the Select option. You don't need it to highlight the portal row until after the subsequent Loop has finished. Use Select when the portal row described by $active is finally settled on. That's only if you want the row to highlight natively. If your "the row highlights (changes text and background color)" is sufficient, I guess you could abandon the Select option altogether.

                     

                    And begin the whole script with a Freeze Window so that none of this looping behaviour is detectable.

                     

                    Bob

                     

                    PS Off Topic: Isn't it annoying that one's own posts don't appear in the email feed from this site?

                     

                     

                    Bob Stuart

                    Lord Of The Files

                    Think Data Pty Ltd

                    Noosa

                    Queensland

                    Australia.

                     

                    +61 7 5442 5624

                    +61 413 350 993

                    • 7. Re: Portal Scroll Technique needed [XPOST]
                      RayCologon

                      MicheleOlson wrote:

                      1] Without the Select on the GTPR step, the cursor enters a field. Field is set to not enter in Browse, but the script overrides that. (Don't like that)

                       

                      Hi Michelle,

                       

                      Scripts routinely ignore layout constraints regarding field entry. Mostly that's a good thing, though I agree it is less than convenient in cases such as this one. The solution, however, is (regardless of whether the Select attribute is enabled for the GTPR step) to conclude the script with a step that either exits the record or places focus elsewhere.

                       

                      MicheleOlson wrote:

                      2] After the 1st 24 records, the script selects the correct portal row, BUT it is always the bottom row. (Don't like that. Would prefer it was a middle row if it has to be anywhere except where it was originally. [do I need a divide by 24 here to determine the position?? thinking aloud]

                       

                      You can do some 'fancy footwork' with the GetLayoutObjectAttribute( ) function to calculate the last displayed row of a named portal object. Once you do that, you'll be able to capture the actual scroll position of the portal prior to leaving the layout of origin, then reinstate it with precision after navigating to the destination record. That way the highlighed row will be returned in the same position after the script has run.

                       

                      Regards,

                      Ray

                      ------------------------------------------------

                      R J Cologon, Ph.D.

                      FileMaker Certified Developer

                      Author, FileMaker Pro 10 Bible

                      NightWing Enterprises, Melbourne, Australia

                      http://www.nightwingenterprises.com

                      ------------------------------------------------

                      • 8. Re: Portal Scroll Technique needed [XPOST]
                        MicheleOlson

                        Bob,

                         

                        Here is my script.

                         

                        Freeze Window Set Variable [ $count; Value:Count(cus_CUS_all_X::zkc_constant) ]

                        Set Variable [ $active; Value:Get ( ActivePortalRowNumber ) ]

                        Go to Related Record [ From table: “cus_CUS_all_X”; Using layout: <Current Layout> ]

                        Go to Portal Row [ Case($count - $active <12 or $active < 24; $active;$active+12)

                             /* 24 rows in portal if $active < 24, go to $active

                             if $count - $active < 12, go to $active

                             otherwise position the active record in the middle of the portal*/ ] [ No dialog ]

                        Commit Records/Requests

                        [ No dialog ]

                         

                        If it can be improved upon, please do so.

                         

                        Michele

                         

                         

                        On the PS Off Topic: I have no luck with the email feed from this site. I have turned them on and not found what I received useful. I have turned them off and now look once a day to see what is posted and if there is an answer I can offer. RSS is interesting, but not quite what is needed. It is confusing; from wherever you apply the choices are the same and they don't include RSS of all "spaces" AFIKT.

                         

                        I do not believe the site is as active as it was. BITODBWC (back in the old days before Web Crossing - did I just make this up?), I used to post fairly regularly to help folks when I could.

                         

                        Web Crossing was too much work for me and took too much time. I moved to digest mode and would scan the digest for posts of interest, but got out of the habit of answering many questions. It is enough of a distraction to have email popping in from clients when you are trying to work through a logic flow – I just decided I was spending too much time on the lists.

                         

                        I've been giving the new format a try again. I like the look, but I don't feel it offers what we "used to have" by a long shot. Perhaps as they say, it's hard to teach an old dog new tricks, but some of the developers who have been around for 20+ years do have quite a few tricks to share.

                         

                        In the current age, people don't spend much time waiting for something to work. They try it; a so-so experience, they try it again, but if that is not better, they move on. I believe FMI is trying to make this a good resource for developers, but... we will see.

                        • 9. Re: Portal Scroll Technique needed [XPOST]
                          MicheleOlson

                          From another developer (Joel Shapiro @ FMPug)

                           

                          This suggestion:

                          "Another option would be to *not* GTRR.  Instead, set a global field 

                          ("gCustomerIDselected") w/ each click of a portal row, capturing that 

                          row's customerID.  Then, once you set up a TO to the selected Customer 

                          record, all the fields on the "main" part of the layout would all be 

                          related fields instead of local to the current record.  This way the 

                          portal will never need to re-draw."

                           

                          This is the best choice for the result I wanted. The portal highlights the appropriate record. There is no movement of the portal records when selected. A very short script is used:

                           

                          Set Field [ CUS_Customer::zkg_selectedCusID; cus_CUS_all_X::zkp_cusID ]

                          Commit Records/Requests

                          [ No dialog ]

                           

                          Thanks to all for ideas and advice.

                           

                          Michele

                          • 10. Re: Portal Scroll Technique needed [XPOST]
                            Bobster

                            Hi Ray & Michele,

                            • 11. Re: Portal Scroll Technique needed [XPOST]
                              Bobster

                              What IS GOING ON with this weird interface? Before it became truncated, here's what I posted via email:

                               

                              Hi Ray & Michele,

                               

                              On 10/12/2011, at 2:34 PM, Ray Cologon wrote:

                               


                              You can do some 'fancy footwork' with the GetLayoutObjectAttribute( ) function to calculate the last displayed row of a named portal object.

                              An example formula from Help suggests:


                              "GetLayoutObjectAttribute ( objectName ; attributeName {; repetitionNumber ; portalRowNumber} )


                              When portalRowNumber is 0 or not specified in the calculation, the function will return data from the first portal row."


                              I'm not sure, though, about the attributeName parameter. What would you enter there?


                              Joel Shapiro's suggestion of basing the layout on the self-relationship is a Great idea!


                              Regards,

                              Bob.


                               

                              Bob Stuart

                               

                              Lord Of The Files
                              Think Data Pty Ltd
                              Noosa
                              Queensland
                              Australia.

                               

                              +61 7 5442 5624
                              +61 413 350 993

                              • 12. Re: Portal Scroll Technique needed [XPOST]
                                RayCologon

                                Bobster wrote:

                                What IS GOING ON with this weird interface? Before it became truncated, here's what I posted via email:

                                 

                                Hi Bob,

                                 

                                Yes, it appears that the email interface has some "quirks", to put it mildly. Among other things, it appears to choke on any quoted passage, with the result that the forum is littered with posts that have nothing more than an appellation line. Odd.

                                 

                                 

                                Bobster wrote:

                                An example formula from Help suggests:


                                "GetLayoutObjectAttribute ( objectName ; attributeName {; repetitionNumber ; portalRowNumber} )


                                When portalRowNumber is 0 or not specified in the calculation, the function will return data from the first portal row."

                                 

                                The trick (and hence my reference to 'fancy footwork') is to get the object bounds of the portal object, and the object bounds of an object within the portal row, and compare them for each successive row, until the top coordinate of the row object equals or exceeds the bottom coordinate of the portal object, then subtract one and you have the row number of the last visible row in the current scroll position of the portal.

                                 

                                It's an exercise you can perform either as a fixed calculation (for a given maximum row count), within a scripted loop or using a recursive function. I have a few recursive custom functions for this and related purposes, but any of the methods I've mentioned will solve Michelle's original problem.

                                 

                                Bobster wrote:

                                Joel Shapiro's suggestion of basing the layout on the self-relationship is a Great idea!

                                 

                                Nice left-of-field suggestion from Joel, which changes a number of things and more-or-less incidentally works around the portal-pop issue. For occasions where the Status Toolbar will always be hidden and locked out of view, it's a techniques that has merit, but otherwise it may tend to confuse the user, as the standard toolbar widgets will no longer either reflect or affect navigation.

                                 

                                Regards,

                                Ray

                                ------------------------------------------------

                                R J Cologon, Ph.D.

                                FileMaker Certified Developer

                                Author, FileMaker Pro 10 Bible

                                NightWing Enterprises, Melbourne, Australia

                                http://www.nightwingenterprises.com

                                ------------------------------------------------

                                • 13. Re: Portal Scroll Technique needed [XPOST]
                                  thosliot

                                  Ray

                                   

                                  I'm interested in your use of a recursive function here, but wonder whether it is necessary. Can you not instead used a fixed calculation which includes calculating the portal's current maximum row count?

                                   

                                  On 10 Dec 2011, at 07:56, Ray Cologon wrote

                                   

                                  It's an exercise you can perform either as a fixed calculation (for a given maximum row count), within a scripted loop or using a recursive function. I have a few recursive custom functions for this and related purposes, but any of the methods I've mentioned will solve Michelle's original problem.

                                   

                                  • 14. Re: Portal Scroll Technique needed [XPOST]

                                    Hi Michele,

                                     

                                    In addition to the great advice, you might try this to address your Item #2 concern:

                                     

                                    To place your current record at the top of a portal so it can display its highlight selection, script might be:

                                     

                                    Set Variable [ $row ; Get ( ActivePortalRowNumber ) ]

                                    Go To Related Record [ from table Parent 2 ; current layout ]
                                    Go To Portal Row [ last ]

                                    Go To Portal Row [ no dialog ; $row ]

                                     

                                    Of course FM can't scroll past the last record so if it is the last record (or any of the last showing in the portal) then it will not scroll up.  And you will need to commit the record or use Go To Object[ dummy ] if you do not wish to commit the record.

                                     

                                    Message was edited by: LaRetta

                                    1 2 3 Previous Next