12 Replies Latest reply on Jun 14, 2012 10:49 AM by philmodjunk

    Hide Empty Layouts?

    BradWieland

      Title

      Hide Empty Layouts?

      Post

      I have several product categories: Doors, Cabinets, etc.

      Each of these layouts use unique fields ("Doors" layout uses only "Doors-related" fields, "Cabinets" layouts uses only "Cabinets-related" fields, etc.).

      Is there a way to hide the empty layouts? When the user is viewing "All Records", many of the pages are empty because only the appropriate pages (layouts" are populated.

      Maybe I should be using separate Tables? Would that do it?

        • 1. Re: Hide Empty Layouts?
          philmodjunk

          I think separate tables creates more problems than it solves.

          Do you have FileMaker advanced?

          If so you can create a custom menu that substitutes your script for Show All records and Show Omitted Only. Event the keyboard short cut for Show All records will perform your script if you do this.

          Then your script can find all records of the type that is appropriate for your current layout.

          • 2. Re: Hide Empty Layouts?
            BradWieland

            I've just installed FileMaker 12 Advanced today. So, with one button, I would be able to show only certains records and only certains layouts? And then, with another button, I would be able to show a different set of records and layouts? While omitting all others?

            How would I approach this?

            • 3. Re: Hide Empty Layouts?
              philmodjunk

              What suggested was to set up custom menus--something you'll want to read up on such that users will be unable to access records on a given layout unless they are of a "type" that is compatible with that layout. Thus, they would be unable to pull up "cabinet" records on a doors layout. The third part of this is a script trigger on the layout that constrains the found set to a specified type when the user returns to browse mode--that way they can perform a find by entering find mode and specifying criteria, but when the find is performed, the trigger kicks in and drops out any reocrds of the wrong type for the current layout.

              This is not the only way to do this. Another option is an onRecordLoad trigger that changes layouts when you change records such that when you click the book control to see a different record, the layout changes, if necessary, to the layout designed for that type of item. (If the next record is a cabinet record, the layout changes to the cabinet layout. If the next record is a Door record, the layout changes to a Door layout and so forth...)

              It would take additional work to add your own drop down layout that only lists layouts compatible to the current circumstances, but this could be done. I'm not clear on what those circumstances would be, however.

              • 4. Re: Hide Empty Layouts?
                BradWieland

                Phil, you are definitely understanding what I'm trying to do. The onRecordLoad trigger sounds closer to the way I want this to work than the custom menu route. I will try to find advice on creating onRecordload trigger events. Do you have any pertinent links to point me toward?

                • 5. Re: Hide Empty Layouts?
                  DavidJondreau

                  Instead of separate layouts, you could use a single layout with a tab control panel. That panel would have a tab for each category. You can hide the selection tabs and use an onRecordLoad script trigger to go to the correct tab.

                  • 6. Re: Hide Empty Layouts?
                    philmodjunk

                    No specific links. Do be careful with OnRecordLoad, OnLayoutEnter and other such triggers. Scripts that change layouts can trip these same triggers. In some cases, such a script can trip its own trigger and trap you in an infinite loop...

                    I often wrap such trigger controlled scripts in the following If block:

                    If [ Not $$TriggersOff ]

                       # Put script steps here

                    End If

                    That way, I can do this in scripts that will trip this trigger underst circumstances when I don't want them tripped:

                    Set variable [$$TriggersOff ; Value: True ]
                    Go to Layout [layout with script trigger]
                    Set variable [$$TriggersOff ; Value: False ]

                    David's suggestion is an excellent option to consider. If you use it, you'll need to assign an object name to each panel of the tab control and use Go to Object to select the appropriate panel to reveal.

                    • 7. Re: Hide Empty Layouts?
                      BradWieland

                      Working on setting up these tabs and have assign an object name to each tab panel. The four tab panel names and their corresponding object names are:

                      Tab 1: Doors - Doors Tab

                      Tab 2: Cabinets - Cabinets Tab

                      Tab 3: Accessories - Accessories Tab

                      Tab 4: Mouldings - Mouldings Tab

                      Do I basically do my layouts as normal except that everything is placed within the boundaries of the corresponding Tab Panel?

                      If the boundaries of the Tab Panel fill the entire page, do I "anchor" the edges?

                      And, how do I hide the Tabs?

                      • 8. Re: Hide Empty Layouts?
                        philmodjunk

                        Do I basically do my layouts as normal except that everything is placed within the boundaries of the corresponding Tab Panel?

                        Sounds right. As in any user interface design, test things as you go and make what adjustments may be necessary to get it to work.

                        If the boundaries of the Tab Panel fill the entire page, do I "anchor" the edges?

                        You can but you don't have to. You might test your system with both options and see if there are any advantages or disadvantages for your specific designs.

                        And, how do I hide the Tabs?

                        Tabs and their borders can be made trans parent of the same color as the layout's color.

                        • 9. Re: Hide Empty Layouts?
                          BradWieland

                          OK, I have the tabs set up and am populating the fields within the various Tab boundaries. Having problems, though. When I copy fields into one Tab area, it copies into ALL the tabs! What's up?

                          By the way, I don't see these fields being copied when I view Layout mode but I do in Browse mode...

                          Here's a screen shot showing 2 different tabs selected:

                          • 10. Re: Hide Empty Layouts?
                            philmodjunk

                            Make sure that no part of your tab control touches or crosses the boundary line between header and body.

                            Since this type of layout is often viewed only with "view as Form" selected, you may want to delete the header part from your layout.

                            • 11. Re: Hide Empty Layouts?
                              BradWieland

                              So, if I still need to have a header graphic, just add it as a picture insert to each layout? Would I include the header graphic within the Tab Control Boundaries?

                              Also, the only way to "remove" a "Header" is to make it a "Title Header", right?

                              • 12. Re: Hide Empty Layouts?
                                philmodjunk

                                You can drag any objects, such as your graphic down in to the body. You'd need to resize your body and reposition things to make room for it.

                                To delete a layout part, you can click the part label while in layout mode and press the delete key. You can also use the part set up dialog to remove it.

                                Rmoving this layout part is an option to consider, not something you have to do. It's just a way to make sure your tab control doesn't get positioned a pixel too high by mistake during future adjustments to the design of your layout.