Guard conditions
Guards are conditional logic used by both:
-
the
enabled
anddisabled
properties for rich-media controls -
the
to
property for transitions
Guards use a built-in condition parser and evaluator.
Symbols in conditional statements
The following symbols and built-in functions are supported:
-
comparison operators:
==
,!=
,>
,>=
,<
,<=
,!
-
logical operators:
&&
,||
-
built-in function:
isEmpty
Condition rules
When creating conditional statements:
-
Parenthesize all the operands of logical operators.
-
Parenthesize the entire guard condition.
-
Prefix with
#
all operands that fetch a form control value, constant value, or dynamic variable value.
Examples of conditional statements
-
(!(isEmpty( # view1.customerName.text)))
-
( # view2.terms.item.0.isChecked == true)
-
( # view2.terms.item.1.isChecked == true)
-
( # view2.accountType.selectedText)
-
(!(isEmpty( # view1.customerName.text))) && ( # view2.terms.item.0.isChecked == true)
-
( # view4.services.selectedIndex == 1)
For an example of a widget definition with conditions, see Example with multiple nodes and conditions.