5 Replies Latest reply on Feb 2, 2012 9:27 AM by philmodjunk

    Portal and Window Popup

    ShaikhAtta1238

      Title

      Portal and Window Popup

      Post

      I want some help on the below

       

      1.  I want to popup a portal when I fill the fields of the parent table and click a button. Once the portal is popped up then I will add the details 

       

      2. I want to open a new auto fit window when a button is clicked. 

       

        • 1. Re: Portal and Window Popup
          philmodjunk

          1) you can't "pop up" a portal all on it's own, but you can do something close to that.

          1. Put the portal inside an invisible tab control with two panels--one with the portal and one without--and use a script to select the second panel to reveal the portal.

            or

          2. Use the new window command to open up a small floating window (that what you want for request #2?) This can be set up to simulate the behavior of a small modal dialog so that the user cannot lose the window back behind the original window. They could then enter/edit data in the portal in this window and either click a button on the layout or the close button in the top right corner to close the window. (Enabling the close button in the corner requires using FileMaker Advanced to create a custom menu for the pop-up window's layout.)

          2) Define what you mean by "auto-fit". Will this solution need to run in Windows, Mac or both systems? (The two systems manage windows differently.)

          • 2. Re: Portal and Window Popup
            ShaikhAtta1238

            thanks alot, Ok I got the 1 solution and its great but how to make an invisible tab and to the 2nd problem I want that when ever my database loads it should automatically adjust the window to the size of the screen and it will be for windows . 

            • 3. Re: Portal and Window Popup
              philmodjunk

              Adjust window [maximize] will expand the current window out to the limits of the FileMaker application window.

              An invisible tab control is a tab control with fill and  outline settings that make them either transparent or the same color as your layout background. You can sue zero width tab labels. In the inspector, you can use the name box on the position tab to give each tab panel an object name. Then the go to object script step can be used to put the focus on a specified tab panel to select it. WHen you  use go to object to specify the empty panel the portal will disappear. When you use go to object to specify the panel with the portal, it appears.

              You can use the OnRecordLoad script trigger to perform a script to select the appropriate panel when you first access a specfic record on your layout.

              • 4. Re: Portal and Window Popup
                ShaikhAtta1238

                Thanks for the auto fit option, but I want the software to work on all resolutions, and want to keep all the objects in the center of the screen.

                • 5. Re: Portal and Window Popup
                  philmodjunk

                  Working with "all resolutions" is a problem with FileMaker, You can work with the current zoom settings, but adjusting for all possible monitor sizes and resolutions isn't something that FileMaker does well. If you have to support a variety of monitor specs, you may end up creating different layouts scaled to work with different subsets of these display settings and then use a preferences table to control which are used on a given machine.

                  Here's some code I use to place a small window--to be used like custom dialog--in the center of the screen:

                  Set Variable [$zoomScale ; Value: Get(WindowZoomLevel) / 100
                  Set Variable [ $PaletteWidth; Value:Let ( width = 650 ; If ( Right ( Get(WindowZoomLevel) ; 1 ) = "*" ; width * 1.3 ; width ) ) * $zoomScale ]
                  Set Variable [ $PaletteHeight; Value:Let ( hgt = 165 ; If ( Right ( Get(WindowZoomLevel) ; 1 ) = "*" ; hgt * 1.3 ; hgt ) ) * $zoomScale ]
                  New Window [ Name: "New Version"; Height: $PaletteHeight; Width: $PaletteWidth; Top: Div ( Get ( ScreenHeight ) - $PaletteHeight ; 2 ); Left: Div ( Get ( ScreenWidth ) - $PaletteWidth ; 2 ) ]

                  Note checking the windowzoomlevel for * checks for the "enlarge window contents" preference that can be specified on windows systems. $zoomScale adjusts the size of the window dimensions so it works with zoom levels other than 100%