5 Replies Latest reply on Feb 13, 2015 5:04 AM by erolst

    Script trigger to add new tab?

    amandahbell

      I am trying to create a fish sampling schema:

      The first page they go to is the stream info.

      They then add the collection information on a second layout into tabs.

       

      What I would like is that I could give them a button that has a Script trigger to add another collection effort and have that collection Method as the Tab name so that they could flip between them.

        • 1. Re: Script trigger to add new tab?
          jrenfrew

          What version?

           

          In 13. You could possibly create pile of tabs with a variable as a name and reduce the padding so they repeat to the smallest size possible, and hide all the fields on that tab of the variable was not set.

          Then the tab would grow when the name in the variable was set...

          Create  approval to the related collection  records, then show only the first row on tab 1, the second on tab 2 etc.etc.

          • 2. Re: Script trigger to add new tab?
            erolst

            If your data structure looks like e.g.

             

            Streams --< Collections --< Catches

             

            you could use fake tabs by adding horizontal single row portals into a Collections relationship driven by a utility field, with a different initial row; “switching tabs” then means actually switching the collectionID, and thus the displayed related Catches records.

             

            This obviously needs a certain number of portals set beforehand, but then the number of tabs in a tab control cannot be changed programmatically, either. 

             

            amandahbell wrote:

            What I would like is that I could give them a button that has a Script trigger

             

            Just to confuse the issue : if you define a button, you don't need a trigger – a button is defined as an object that has an “OnClick” trigger (though that event type isn't (yet) named anywhere in Filemaker).

            • 3. Re: Script trigger to add new tab?
              amandahbell

              Yes, I have 13.

               

              Would it work to have a Portal inside of another portal? I can't figure out how to do a popover inside of a popover.

               

              Yes, the structure is Streams --< Collections --< Catches

               

              Sorry about the script trigger button thing. I've only started with Filemaker a week ago.

              • 4. Re: Script trigger to add new tab?
                flybynight

                There are certain containment objects that you cannot nest in each other. You can't put a portal inside another portal. Same with pop-overs. There can only be 1 active/open pop-over at a time.

                And you can't get around any of these rules by hiding them in another containment object. For instance, you can have a portal in a pop-over… but not if that pop-over itself is already in a portal.

                • 5. Re: Script trigger to add new tab?
                  erolst

                  See here for a sample file outlining the idea suggested in my post.

                   

                  Actually, two approaches – one using a tab-like series of portals, another one a vertical portal. As usual, there are other solutions, but the optimal one probably depends on your workflow / the amount of collections you want to record for any given stream.