Skip links

Popover button

Popover settings

What is a popover button in FileMaker?

A popover button in FileMaker databases is a button that opens a popover window when clicked, in which further layout elements can be placed. The popover window appears above all other layout elements and can be scaled to a maximum of the same size as the visible layout area. Popover buttons are used when a lot of information needs to be displayed in a small space or as an info window for linked information from other databases.

Adding a popover button

Toolbar in layout modeTo insert a new popover button into the current layout, first use the menu command [View > Layout mode] to open the layout mode in FileMaker. Now click with the mouse on the button tool in the FileMaker toolbar (to the right of the field tool) and hold down the mouse button. In the pop-up menu, select the entry [Popover button]. Now hold down the mouse button and drag a new popover button to the desired position in your layout. As soon as you release the mouse button, a new popover button is created at the corresponding position and the cursor is positioned in the keypad, where you can immediately label the button.

Popover settings

Double-click on the new popover button to open the popover window, whose settings are opened by double-clicking on the popover window again.

Popover settings

Title bar of the popover window

Enter a title for the popover window in the first field. Click on the button [Specify...] you can enter a calculated value as the title. With the checkbox [Show title bar] to show or hide the title bar in the popover window.

Position of the popover window

You can use the buttons below to specify the direction from which the popover window should open in relation to the popover button. If there is not enough space to display the popover window in the desired position, FileMaker may display the popover window in a different position.

Script trigger of the popover window

With the button [Set script trigger] the following script triggers can be defined for the popover window:

  • WithObjectEnter
  • WithObject keystroke
  • WithObjectChange
  • WithObjectValidate
  • WithObjectSave
  • WithObjectExit

Script triggers are very suitable for controlling entries in popover windows. For example, a "OnObjectEnter" script trigger can be used to pre-fill field contents and a "OnObjectExit" script trigger can be used to read field contents or enter them into the database.

Settings in the inspector

In the inspector, a wide range of settings can be made for the overall appearance of a popover window. In the [Presentation] all options for the frame of the popover window and the popover content can be set separately.

Open popover window via script

An important specification in the inspector is the name of the object in the [Position]. This can be used to open the popover window in a script with the function [Go to object] can be opened. Please note at this point that the name of the popover window is decisive for opening the popover window, not the name of the popover button.

Use popover window as interactive input dialog

You can use a popover window as an input dialog in just a few simple steps. The data is only saved in the database when the user clicks on the [Save] clicks. Each popover dialog consists of exactly one popover button and one script.

  1. Create global input fields of each desired field type (e.g. zzGlo_Text_01 to zzGlo_Text_20, zzGlo_Number_01 to zzGlo_Number_10, etc.)
  2. Create a new popover button and place the desired input fields and, if necessary, labels and two buttons [Save] and [Cancel].
  3. Create a new script, e.g. "dlg.My_Dialog" and insert several sub-scripts, each of which can be called with a script parameter.
  4. Create a partial script that is created with the script parameter "trigger.new" can be called up. Insert between If(Get(ScriptParameter) = "trigger.New") and End (if) for each input field the command Set field value (zzGlo_Text_01; "") which automatically clears the fields when the dialog is called up. If required, you can also specify certain values instead of emptying.
  5. Add a script trigger to the popover window WithObjectEnter with the new script and the parameter "trigger.new" added.
  6. In the new script, create another partial script that can be called with the script parameter "sf.Save". Between If(Get(ScriptParameter) = "sf.Save") and End (if) you can now execute any script that creates the data record or, if necessary, other related data records in your database from the input fields. Then empty the input fields and add the following at the end End (if) the command Exit current script added.
  7. Press the button [Save] with the call of the new script and the corresponding script parameter "sf.save".
  8. Create another partial script "sf.cancel" and assign the button [Cancel] with script call and parameter "sf.cancel".
  9. Insert the Go to object "Popover window" command at the end of the script. If the script is called without parameters, the popover window opens.

Example script for a popover dialog

#
# trigger.new
If [ Get ( ScriptParameter ) = "trigger.New"]
    Set field value [zzGlo_Text_01; ""]
    Set field value [zzGlo_Date_01; Get( SystemDate ) ]
    Set field value [zzGlo_Text_02; Kunden::Sachbearbeiter ]
    Set field value [zzGlo_Text_03; "" ]
    Set field value [zzGlo_Text_04; "" ]
    Exit current script []
End (if)
#
# [Save] button
If [ Get ( ScriptParameter ) = "sf.Save"]
    Set field value [Actions::Action_type; zzGlo_Text_01]
    Set field value [Actions::Date_Action; zzGlo_Date_01]
    Set field value [Actions::Agent; zzGlo_Text_02]
    Set field value [Actions::Action text; zzGlo_Text_03]
    Set field value [Actions::Remarks; zzGlo_Text_04]
    Write change data/query [Suppress data entry validation; Without dialog box]
    Exit current script []
End (if)
#
# [Cancel] button
If [ Get ( ScriptParameter ) = "sf.Cancel"]
    Close popover
    Set field value [zzGlo_Text_01; ""]
    Set field value [zzGlo_Date_01; "" ]
    Set field value [zzGlo_Text_02; "" ]
    Set field value [zzGlo_Text_03; "" ]
    Set field value [zzGlo_Text_04; "" ]
    Exit current script []
End (if)
#
# Open popover window
Go to object [object name: "Popover window"]

Of course, you can add further script triggers to the script as you wish. In this way, you can make your popover dialog fully interactive and, for example, automatically change values during input depending on other values. There are no limits to the possibilities at this point.

Prevent a popover window from closing

Popover windows are automatically closed when the user clicks on a layout content next to the popover window. This behavior can be switched off with a trick so that the popover window becomes modal:

Prevent popovers from being closed accidentally (FMM Forum)

More questions about FileMaker? It's quicker in person.

As part of our Coaching and training services we will be happy to inform you personally about the FileMaker functions you need for the development of your FileMaker solution. Of course, we will be happy to respond to your individual wishes. Billing is individual and fair in 15-minute increments. Pay conveniently by bank transfer or PayPal.

Related Einträge

Share this page:

ERP software as flexible as your company.
We will be happy to advise you.

Customizable ERP software for Mac, Windows and iOS.

You are here: What is a popover button in FileMaker databases?