The Switch allows you to create a 'switch' control structure, as it is often found in programming languages.
<fm:Switch value="1">
<fm:Case value="1">Number 1!</fm:Case>
<fm:Case value="2">Number 2!</fm:Case>
<fm:Case multiValue="3,4,5">Number 3, 4, or 5 :)</fm:Case>
<fm:Default>No Number :(</fm:Default>
</fm:Switch>
Note that the Case component supports both single values (using the "value" attribute) and multiple values (using the comma-separated "multiValue" attribute) to control which values the case matches. "value" is maintained to ensure you may match a single value that contains a comma; aside from this case "multiValue" is preferred.
Name | Required | Default | Description |
---|---|---|---|
multiValue | Optional | N/A | A comma-separated list of values that this case matches |
regex | Optional | N/A | The value to compare the cases to |
value | Optional | N/A | The value to compare the cases to |