9 Replies Latest reply on Aug 22, 2012 1:34 PM by JCPython

    Best approach using Portals for list views

    JCPython

      Title

      Best approach using Portals for list views

      Post

      Im looking to create a section in my runtime similar to whats in the attached image, a bunch of different value list (approx 60 different list).

      I started out by creating a table for each and every list type, then created a tab object with a tab for each list type and a portal related to each list on each tab. not sure if this is the right approach here.

      When user clicks a list type in left column then those records should show in the portal to the right, now these different list will have different field names/types and some will have more fields than others so this leads me to believe that using a portal filter script may be out of the question to navigate through the different list.

      can someone lend their developer expertise and just tell me which methos of doing this would be best for overall performance in the end.

       

      Thanks in advance!

      Screenshot_232.png

        • 1. Re: Best approach using Portals for list views
          philmodjunk

          I started out by creating a table for each and every list type...

          ...now these different list will have different field names/types and some will have more fields than others

          I don't think you can make this happen with a single portal. A portal only refers to one table and it's set of fields. If you've combined all the data in one table, but used different field combinations, you might be able to use one portal.

          More likely, you'd need to create mulitple layouts where the left hand portal is identically sized, formatted, position, but the right hand portal is different in order to display the different data sets from their respective tables and fields. Another option would be to use one layout with all the different portals inside different panels (each with an object name) of an invisible tab control. Clicking your button in the first portal either uses Go to layout to select the appropriate layout or Go to Object to select the appropriate tab panel.

          • 2. Re: Best approach using Portals for list views
            JCPython

            Thanks Phil,

             

            The last option you described with invisible tabs is what i started doing last night before i wondered if it was the best way to go about it.

            What worries me is the possibility of it having a real slow loading time with so many portals on a single layout, not sure if that would be the case.... Does every portal get loaded when entering the layout, or just the visible tab?

             

            also im unsure on how to tell the selected row in the left portal which tab to go to, not sure if what im saying here will make sense, i mean when user clicks "Contact Types" it should go to the tab name tContactTypes, then in the portal row below that if clicked should go to the tab tCreditCardTypes, is it a script parameter i need here or..

            • 3. Re: Best approach using Portals for list views
              philmodjunk

              Add a text field to the table used with your left hand portal. Call it "ObjectName". When you use the Name box at the top of the position tab in the inspector to give each panel of your tab control a name, copy and paste this exact text into the ObjectName field of the corresponding record in this table.

              Now your script can use:

              Go To Object [ PortalOccurrence::ObjectName]

              to select the correct panel in the tab control.

              • 4. Re: Best approach using Portals for list views
                JCPython

                Ohh Okay that seems simple enough! Thank you very much!

                • 5. Re: Best approach using Portals for list views
                  JCPython

                  One last question, I have all these value list in there own table, each table has a RecordID field auto-enter serial, all have a relationship to my settings table

                  Settings::RecordID---x---ValueListTable::RecordID

                  The only way i find i can enter new records from the portals on the settings layout is to runa script that goes to the layout based on the specific value list table and add new record then go back to the settings layout to enter the details.

                  When i use the = operator for the relationships it allows me to add new records on the portal without running a script BUT existing records in the tables dont show in the portal, only newly added records will show up.

                  Is it possible to add new protal records without going to different layouts?

                  • 6. Re: Best approach using Portals for list views
                    philmodjunk

                    Not when using the Cartesian Join operator in your relationship like this. The "Allow creation..." option sets FileMaker up to enter the value of the Primary key from the parent table into foreign key field of the child (portal) table. But with that operator, there is no specific value to enter. (Did you know that if you deleted the RecordID field from either or both tables, this relationship is still valid?)

                    • 7. Re: Best approach using Portals for list views
                      JCPython

                      No i did not know this, so my original way is best using the "X" operator and performing a script attached to a "Add New" button Like this:

                       

                      Go to Layout [ Dev - Laout to the value list table]

                      Go to Record/Request/Page [Last]

                      New Record/Request

                      Go To Layout [Orginal]

                      Go To Portal Row [Select; Last]

                       

                      • 8. Re: Best approach using Portals for list views
                        philmodjunk

                        Or you can go "old school".

                        We simulated cartesian joins long before we had the X operator.

                        Use this relationship:

                        LayoutTable::constOne = Portaltable::One

                        Make constOne a calculation with this expression:

                        1

                        Make One a number field.

                        Now "Allow creation" works, but you also have to becareful to keep the value 1 in the one field of every record--that's automatic for records created in the portal, but may not be if you create records in this portal on other layouts. (You can probably enter 1 as an auto-enter option though...)

                        • 9. Re: Best approach using Portals for list views
                          JCPython

                          Awesome! got it working, Thanks again! :D