Description |
Displays an auto-generated multiple choice dialog box based the options you specify. Choice is useful when a multiple-choice selection is needed or the user must make a decision that will affect the action taken by a Workflow. The value associated with the item that the user selects is placed into a variable where it can be evaluated and acted on. |
Practical Use |
Similar to the Input Box <AMINPUTBOX> action except allows the user to enter a text value in response to a question. The text value is populated into a variable which can be used later in the Workflow. |
Declaration |
<AMSELECTITEM MESSAGETEXT="test" WINDOWTITLE="text" LISTTYPE="option" RESULTVARIABLE="text" ITEMS="text" VALUES="text" SELECTED="1" VALUEONCANCEL="text" FORCESELECT="yes/no" MULTIPLE="yes/no"> |
Example |
<!---This Workflow shows how to use the choice action and make decisions based on the answer--->
<AMVARIABLE NAME="foodchoice"></AMVARIABLE> <AMSELECTITEM MESSAGETEXT="What would you like to eat?" WINDOWTITLE="What's for dinner?" LISTTYPE="option" RESULTVARIABLE="foodchoice" ITEMS="Hamburger,Pasta,Chicken" VALUES="1,2,3" SELECTED="1"> <AMIF EXPRESSION="%foodchoice% = 1"> <AMMESSAGEBOX>You chose Hamburger</AMMESSAGEBOX> </AMIF> <AMIF EXPRESSION="%foodchoice% = 2"> <AMMESSAGEBOX>You chose pasta</AMMESSAGEBOX> </AMIF> <AMIF EXPRESSION="%foodchoice% = 3"> <AMMESSAGEBOX>You chose chicken</AMMESSAGEBOX> </AMIF> |
General Tab Parameters |
Message to display: Specifies the text to be displayed in the choice dialog box. Usually this is a question that the user should select the answer to. Text, Required List type: Specifies the manner by which the list will be displayed on the auto-generated form at runtime. This selection is relevant not only for aesthetics but will also affect the ability of the user to make a multiple choice selection (see below).
Text [options], Required Populate variable with result: Specifies the name of an already created variable that should be populated with the value parameter of the item selected. If the user has selected multiple items the values are returned as a comma-delimited list. text, Required Use items from: Specifies a comma-delimited list of items in the list. The items represent the text value that is displayed not necessarily the value that is returned by the item (that is determined by the VALUES= parameter). list, Required Values: Specifies a comma-delimited list of values in the list. The values represent value(s) will be returned by the item if selected at runtime by the user. There must be an equivalent number of values to items. Each value must have a corresponding item in the ITEMS= parameter. list, Required Selected: Specifies the index (base 1) numbers of the items that should be checked or selected by default. Depending on the list type, the requirements for this parameter differ. In the case of a drop-down and options, one item must be selected. In the case of a list box or check boxes, none or multiple items may be specified. To specify multiple options the numbers should be comma-delimited. list, Required Bring message to front of all other windows: When enabled/selected, displays the input box in front of all other open windows. |
Advanced Tab Parameters |
On Cancel: Specifies the value that should be returned into the variable if the user presses the "Cancel" button. text, Optional - Default (blank) Force selection: Specifies that the user must make a valid selection before continuing. This option is only valid if LISTTYPE= check box or list, other list types automatically force selection. yes/no, Optional - Default YES Allow multiple selections: Specifies that multiple selections are allowed. This option is only valid if LISTTYPE= check box or list, as only those controls support multiple-selection. text, Optional - Default NO Automatically press the OK button after: Specifies the time that should elapse before the message box clears itself. If the value is 0, the message box is displayed indefinitely. number, Optional - Default 0 |
See Also |