12 Replies Latest reply on Jul 22, 2016 8:05 PM by Aigaion

    Making a Portal the "Active" portal - and navigation questions

    Aigaion

      A layout has multiple portals.  In one, which is set to show only one row containing a single Container field, I am displaying a photo.  I've put navigation buttons below it that are intended to let the User move to First, Previous, Next and Last records in the portal.  Obviously, this is an effort to create a slideshow the User can control.  These are not working.   I am assuming the scripts - Go to Portal Row [Select, First], etc.- are not working because this is not the active portal.

       

      (1)  Do you think this is my problem

      (2)  If so, what script step do I need to make this the "active" portal.

       

      I've tried Go to Object but this seems not to be the answer.

       

      Also, what is the best way to capture the number of records in the portal and if the Container field showing in the portal is the 1, 2. 3...N of the total.

       

      Thanks for your help.

        • 1. Re: Making a Portal the "Active" portal - and navigation questions
          planteg

          Hi Michael,

           

          without seeing the contents of the scripts, it's hard to tell. One thing you may try is to Refresh the portal after moving to a different row for example. Portal most of the time needs to be refreshed by using for example Refresh Object().

          • 2. Re: Making a Portal the "Active" portal - and navigation questions
            Aigaion

            Currently the scripts attached to the navigation objects are in the following format:

             

            If(Get(ScriptParameter) = "first"

            Go to Object (Object Name = "imagePortal"

            Go to Portal Row [Select, First]

            Exit Script

            End If

             

            Tried adding the Refresh Object line, but this seems to have no effect.

            • 3. Re: Making a Portal the "Active" portal - and navigation questions
              keywords

              I don't think portal row is the way to go, since the portal has only one row. Portal filtering will work, however. Try this:

               

              1.     Create a global field called, say, rowSelected which you will use to filter the portal

              2.     Set the portal filter to: yourTableName::rowSelected = yourDataTable::recordID

              3.     Create the following script—

              Set Variable [ $thisRow ; Value: yourDataTable::recordID ]

              Set Field [ yourTableName::rowSelected ; $thisRow ]

              Refresh Window [ Flush cached join results ; Flush cached external data ]

              Exit Script [ ]

               

              4.     Create a button placed within the row of your second portal (i.e. the one that shows all records) that runs this script. As the script is running from the context of a portal row, it will select the recoded of the row it is on. The relevant image will then show in the filtered portal.

              1 of 1 people found this helpful
              • 4. Re: Making a Portal the "Active" portal - and navigation questions
                richardsrussell

                This is not a direct answer to your specific question but may produce the effect you're after. Try the script step "New Window" and specify that you want the window to open up in a Form View layout from the child table (that is, the one whose container field is currently being displayed in your portal). You'll see one record from that table, and you can page thru those records 1 at a time while your slide-show window "floats" above the rest of your desktop. Be sure you specify the ability to close that floating window as one of your options; you may want that layout to have a button clearly labelled to do just that.

                 

                New Window Options.jpeg

                 

                You also asked about how to display the total number of records in the portal. Within your parent table, create a Calculation field using the Count function, as in "Count ( Child::One )" (in which the field "One" is itself a Calculation field in the Child table, with Number result = 1).

                 

                Note that, using the floating window described above, you can simply display "Get ( RecordNumber )" and "Get ( FoundCount )" for the Child table itself.

                • 5. Re: Making a Portal the "Active" portal - and navigation questions
                  Johan Hedman

                  Start from bottom. You can create a field that show Count(RelantionshipForPortal::ID_FIeldName) that will show you number of records in your portal.

                   

                  As you wrote, you need be in the portal to be able to navigate up and down.

                  • 6. Re: Making a Portal the "Active" portal - and navigation questions
                    BruceRobertson

                    You might want to  take a look at Simpre, a comprehensive presentation system built in FileMaker, using a web viewer.

                     

                    GitHub - osamunoda/simpre

                    • 7. Re: Making a Portal the "Active" portal - and navigation questions
                      Alejandro Felix

                      Here is a mixed approach, (based on previous answers) that will permit the use of buttons to display the record that you want, without taking care if your portal is active or sleeping...

                       

                      1. Create the filter suggested by Keywords (Steps 1 and 2)

                      2. Create PortalRecordNumber as a calculation field suggested by Richard Russell using the Count function

                      3. Create a list with your child record id's

                      4. Create a position field in the parent table to use as RowSelected in Keywords example to filter the record to display

                      5. Use position = 1 for first portal record, position +1 for next, position -1 for previous, and PortalRecord Number for last.

                      I have the same problem that you, so I will try it now

                      • 8. Re: Making a Portal the "Active" portal - and navigation questions
                        Alejandro Felix

                        What I did was:

                        1. Add a second relationship between parent and child tables: filter = photo_record_id, instead of using the portal filter, to get a faster response while using FM Server

                        2. In parent table create 2 fields: the filter mentioned above and a second with the list of (photo_record_id's)

                        3. In a separate table (like Preferences) create Pointer as a global field that "on open" sets itself to 1

                        4. Create your button bar with your 4 buttons, each one calling a Photo Navigation script using one single number as the parameter of each segment. I use 1 for first, 2 for previous, 3 was for delete (not used) , 4 for next, and 5 for last.

                        5. Create a script that uses 3 variables: total records in your list, original position of the pointer and the button input parameter to generate the new position of the pointer, according to each button

                        6. The new position is used to get the id of the record that you want to show using getvalue (list, pointer)

                        7. You end updating the pointer, to be used in the following click

                         

                        Now... time to learn some spanish... not that hard

                         

                        Script.jpg

                        8. The script has to take care of navigating within the boundaries of your list

                        For the statement on row 12, this is how it goes

                         

                        Posicion.jpg

                        I hope you can take advantage of it

                        • 9. Re: Making a Portal the "Active" portal - and navigation questions
                          philmodjunk

                          It's also possible to set up a three panel slide control with script triggers on the control such that moving from the middle panel (which displays the image) brings up the next or previous image depending on whether you move to the first (left) or last (right) panel.

                           

                          This is a bit of a "smoke and mirrors" trick, but it can be especially nice for thumbnails in a touch interface where you can swipe to move from panel to panel.

                          • 10. Re: Making a Portal the "Active" portal - and navigation questions
                            richardsrussell

                            Phil! Is it really you? Are you truly back? Omigod, we've missed you!

                            • 11. Re: Making a Portal the "Active" portal - and navigation questions
                              philmodjunk

                              Well my previous involvement had become such a major obsession that I had to take a break to get some perspective.

                               

                              Then, once I was out, it was hard to jump back in.

                               

                              Sent from my iPhone

                              • 12. Re: Making a Portal the "Active" portal - and navigation questions
                                Aigaion

                                Thanks to everyone for the answers.  I used an approach based on the approach Alejandro suggested and it is working well.  Appreciate everyone in the community sharing your insights!