With the recently released Troi Dialog Plug-in 6 for FileMaker Pro you can create very powerful Input Dialogs in a few script steps.
Below we show how to display an input dialog with a popup, which displays the values of a second value list, while returning the chosen value from the first list.
This (simplified) example uses fixed text to build the dialog, normally you would fill the dialog with data from your database. In ScriptMaker you need to add script steps to a script, but you can of course copy the script from the example files in the download of Troi Dialog Plug-in.
Implementing the InputDialog
First set the values for the popup. For this popup we fill the optional last parameter, which holds a second value list (with item names).
Set Variable [ $ErrorCode; Value: Dial_SetPopup( "-Popup1" ;"ST0001¶ST0002¶ST0003¶-¶ST0040¶ST0041" ;
"Pen¶Pencil¶Biro¶-¶Stapler¶Paperclips") ]
Now you can set the defaults. Note that for popup1 the default popup item is selected on the basis of the first item list, in this case “ST0003”.
Set Variable [ $ErrorCode; Value:
Dial_SetInput( "-Unused " ; "ST0003" ) ]
Finally show the input dialog with the popup and 2 buttons:
Set Variable [ $Result; Value:Dial_InputDialog(
"-NoteIcon -Popup1 " ; 1 ; "Please select the wanted item: " ; "OK" ; "Cancel" ; "" ;"" ) ]
This will show the dialog:
After the user has closed the dialog it will return the chosen button and the itemID chosen, so $Result will contain for example:
1|ST0002
This means that the user selected Pencil, which corresponds with itemID ST0002 and then clicked the OK button.
Much more functions
This is just one of the functions added by the Troi Dialog Plug-in. On the Troi Dialog Plug-in page you can download a fully functional demo with all the functions explained:
www.troi.com/software/dialogplugin.html
It is a great and easy way to enhance your database for you or your customers.