5 Replies Latest reply on Apr 4, 2014 6:51 AM by philmodjunk

    Popover as a modal dialog



      Popover as a modal dialog



           at a recent FM13 seminar (in Australia) a presenter briefly showed a method for using popovers as modal dialogs. The scripting was displayed very briefly and I did not fully understand the mechanism and how the button allowed a user to exit out of the popover. How is this achieved?




        • 1. Re: Popover as a modal dialog

               There's a script step called Close Popover

          • 2. Re: Popover as a modal dialog

                 Hi PhilModJunk,

                 Thanks. How do you get a popover to behave as a modal dialog in the first place? At the seminar the presenter indicated there had been a little contention and irritation associated with this issue and perhaps a little forum angst. I do not wish to stir this pot or annoy anyone.

                 Here is a solution I am trying to work but not much luck ,

                 Script trigger on popover (Popover 1) setup - On exit execute script "modal"

                     If [$$Modal = 0]

                           Go to  Object [object Name: "Popover1"]

                                  #my attempt to keep the popover open

                     End if

                 A button on Popover1 which calls the script "Close popover"

                     Set Variable [$$Modal; Value:1]

                     Close Popover

                     Set Variable [$$Modal; Value:0].


                 This feels clumsy ( I think I am weak on understanding how boolean states function in scripts) and also does not seem to work, will 'go to object' open a popover?

                 Thanks again,


            • 3. Re: Popover as a modal dialog

                   I had to think about this for a moment as I didn't see the need for the extra coding, but I gather that it's the "modal" behavior that is the problem since clicking outside of a popover closes the popover--which is not typical of a modal dialog. That hasn't really concerned me too much as closing the popover could be seen as an informal version of closing a modal dialog to cancel.

                   It's simpler to open a new window that is modal than to get a popover to mimic modal behavior so I guess you have to choose between some extra coding to keep the popover from being closed prematurely or using a window for a modal dialog that has extra "stuff" along the edges of the window that isn't typical of a modal dialog.

              • 4. Re: Popover as a modal dialog


                     I managed to contact to the presenter and asked him to review my script above (it was buggin me not knowing how it worked). He suggested my first script (that makes the popover behave as modal) could be replaced with an On Exit trigger script step.

                            Exit Script [Result: $$Modal] 

                     This works but I don't quite understand why ( I mentioned I'm Booleanally challenged).

                     He also mentioned I might need a step in the second script (Close popover)

                           Commit records ( I'll have to look into this one and see what it does, I thought Filemaker automatically saved records when you exited a field).

                     Thanks for your help.

                • 5. Re: Popover as a modal dialog

                       FileMaker automatically saves (commits) a record when you click the layout background or change records (not fields).