Show List Dialog (script step reference)

Troi Dialog Plug-in for FileMaker Pro

Show List Dialog

Displays a list dialog box, from which the user can choose an item.

SyntaxScript step badge

Show List Dialog [ Select ; Result ; Title ; Prompt ; Button 1 ; Button 2;
                   Button 3 ; Button 4 ; List items ; Switches ; Icon ;
                   Custom icon ]

Options

Select entire contentsreplaces the entire contents of a field with the result. If not checked the result replaces the currently selected portion of the field
Resultthe button clicked + the item selected
Titlethe title of the dialog
Promptthe message text of the dialog
Button1..4the text of the 1st to the 4th button (from right to left)
Switchesthis determines the behavior of the dialog and which information is returned
List itemsthe list of items (separated by a "|" char) which the user can choose from
Iconselect one of "No Icon", "Note Icon", "Caution Icon", "Stop Icon", "Custom Icon" or leave empty
Custom Icon(optional) container with the icon to show

Switches

If you specify an empty button text, no button will be displayed.

Switches can be empty or you can add one or more of these switches:

-ReturnButtonTextreturn the *text* of the button, instead of the number
-ReturnListTextreturn the *text* of the listitem selected, instead of the index in the list
-AllowMultipleSelectionallows the user to select multiple items from the list. Selected items are returned separated by the pipe character
-ExtraLineHeight=xspecify extra height (in pixels) for each item in the list

You can also add one of these switches:

-DefaultButton1this indicates button 1 will be selected when the user presses the ENTER key on the Numeric Keypad
-DefaultButton2this indicates button 2 will be selected when the user presses the ENTER key on the Numeric Keypad
-DefaultButton3this indicates button 3 will be selected when the user presses the ENTER key on the Numeric Keypad
-DefaultButton4this indicates button 4 will be selected when the user presses the ENTER key on the Numeric Keypad

You can also add one or more of these switches:

-Button1NeedsTextif you add this switch button 1 is disabled until the user selects an item
-Button2NeedsTextif you add this switch button 2 is disabled until the user selects an item
-Button3NeedsTextif you add this switch button 3 is disabled until the user selects an item
-Button4NeedsTextif you add this switch button 4 is disabled until the user selects an item

You can also add one of these switches:

-StopIconshows a stop icon (indicating this is something severe which the user needs to address )
-CautionIconshows a caution icon (indicating this dialog warns the user)
-NoteIconshows a note icon (indicating this dialog gives the user information)
-CustomIconshows a custom icon. This icon needs to be set before with the Dial_IconControl function

You can also add this switch:

-IconSize=48display the icon at 48×48 pixels
-Width=xmakes the size of the dialog x pixels wide
-Height=ymakes the size of the dialog y pixels high

You can also add this switch:

-StopOnESCif you add this switch the user can press the ESC key to leave the dialog. The dialog returns as button number 0

Returned Result

Data type returned

Text

Result

The number of the button that was clicked followed by the index in the list of the item that was selected. By adding switches this function can also return the text of the button and/or the item selected.

Originated in

Troi Dialog Plug-in 7.5

Compatibility

FileMaker Pro 16 to 17

Considerations

See Dial_SetListInput if you want to preselect an item from the list.

You can type the first letter of the item you want to select.
With the switch: -AllowMultipleSelection you allow the user to select multiple items from the list. Use the Command key on Mac OS or the Control + Alt key on Windows to select or deselect extra items. Or use Command-A (on Mac OS) or Control-A (on Windows) to select all items.

You can also preselect multiple items with Dial_SetListInput. Separate them with a pipe character, for example “fire|water”.

Example

Show List Dialog [ Result ; "MyList title" ; "Please select a fruit:" ; "OK" ; 
				"Cancel" ; "Help" ; "Stop" ;  "Apple|Pear|Lemon" ; "-NoteIcon" ]

This will show a list of 3 items to choose from, with a note icon. If the user chooses the first item and presses the OK button “1|1” will be returned.

Example 2

We assume that in your FileMaker file the following fields are defined:

gFlavors		Global, text
result     		Global, text

gFlavors should contain a list of items to choose from with each item separated by a “|”. Add the following script steps:

Set Variable [ $Switches ; "-CustomIcon -returnListText  -Button1NeedsSelection"]
Show List Dialog [ Result ; "Fruit dialog" ; "Please select a fruit:" ; 
				"OK" ; "Cancel" ; "" ; "" ; gFlavors ;  $Switches ]

This will show the list of items to choose from. The dialog uses a custom icon. This icon needs to be set before with the Dial_IconControl function. The OK button can only be pressed after the user selected an item.

Related functionsFunction badge

Dial_GetButton
Dial_GetInput
Dial_ListDialog
Dial_SetListInput

Related topics

Troi Dialog Plug-in online help (overview)


Online Help Page for Troi Dialog Plug-in for 14 to 17 –> Show List Dialog (dialp7309) 2018-1114 15:15:33