2 Replies Latest reply on May 10, 2009 11:07 AM by KIDO

    Can I create a small Popup Form to get data

    mwesuk

      Title

      Can I create a small Popup Form to get data

      Post

      Hi

      I have a portal that lists parts used for a job. If I want to add another part I have to go to the bottom line of the portal to add a new part.

      Is it possible to create a small form that would pop up over the existing layout to enter the details of the new part?

      Thanks Mike

        • 1. Re: Can I create a small Popup Form to get data
          philmodjunk
            

          You have two options: Simple but limited, Much more flexible but "clunky".

           

          Simple but limited.

           

          There's a script step called "Show Custom Dialog" you can use. You can specify an input field to receive user input. It's limited because you can't format the input field with a value list or do error checking on the input while the dialog is up (you have to error check after the dialog is dismissed.) If you can live with those limitations, use this approach.

           

          Much more flexible but "clunky".

           

          There's a command called "new window" that you can use to open a new window of specified size and screen location. I'd look up it's details in the on line help if you choose this option. Since this simply opens a new window and you can choose any layout in your file for this new window, you have all the formatting capabilities of any filemaker layout.

           

          There are problems you have to deal with, however:

           

          The new window is not "modal". If your user clicks on the larger window in the background your pop up will disappear behind as the larger window now has the focus and pops to the front. Filemaker Inc has not given us the "modal" property parameter for this function that would make it much nicer. Instead, you have to add script steps that mimic the desired modal behavior. You have to hide the status area and lock it. Disable user aborts and then Pause the script. Any buttons you put on your pop up (and you must have at least one button) must either Resume, Halt, or Exit the current script as well as closing the pop up. This is clunky because it leaves the close and minimize window controls visible, but the paused script blocks them from working--which can lead to user confusion.

           

          If you are using Windows, there's an added problem: The back ground window will automatically resize to a smaller size when the new window is created. The only fix I've been able to come up with is to add a step after the New Window step that resizes the window out to the current screen size dimensions. Then, any code that closes the pop up window also includes a step to maximize the current window. The background window "twitches" a bit with this, but it's the best I've come up with when using FMP 10 v2.

          • 2. Re: Can I create a small Popup Form to get data
            KIDO
               <!--            @page { margin: 2cm }           P { margin-bottom: 0.21cm }        -->

            Hi Mike

             

            Phil is absolutely right. But if you wish an alternative to automate the boring scrolling, you can try the following:

            Create 1 or 2 buttons next to your portal and add the following scripts to them

             

            Button 1 – Add Parts

            # use a global variable if you wish to return to same portal row, otherwise disregard it.

            Set Variable [$$mypr; Value: Get (PortalRowNumber) ]

            Go to Portal Row [Select; Last]

             

            Button 2 - Done

            Go to Portal Row [Select; No Dialogue; $$mypr]

             

            It's not very elegant but it works.