fm:Switch


The Switch allows you to create a 'switch' control structure, as it is often found in programming languages.

Example

<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.

Supported attributes

NameRequiredDefaultDescription
multiValueOptionalN/AA comma-separated list of values that this case matches
regexOptionalN/AThe value to compare the cases to
valueOptionalN/AThe value to compare the cases to

See also