Boolean operators

A path expression can be prefixed with a boolean operator, which causes the expression to evaluate to a boolean value.

Operator Description
! inverts the boolean value; converts 0 or null to true
!! inverts the boolean value twice; converts 0 or null to false

In the following example, the controls are disabled or hidden when the bound list is empty:

<!-- disabled=true when size=0 -->
<MyAddressControl disabled="${!user::addresses.size}"/>

<!-- visible=false when size=0 -->
<MyAddressControl visible="${!!user::addresses.size}"/>

Applicability

A boolean operator is applicable to any path expression, not just expressions of boolean type. However, restrictions apply depending on which markup extension is used.

Markup extension Applicable
fx:Evaluate all non-content expressions
fx:Observe all non-content expressions
fx:Push not applicable
fx:Synchronize only if the binding source implements WritableValue<Boolean>

This site uses Just the Docs, a documentation theme for Jekyll.