The relevant Property

Release 2.0 - ...

Indicates whether the model item is currently relevant. Instance data nodes with this property evaluating to false are unavailable in the user interface and can be removed from submission serialization.

Computed Expression Yes
Legal Values Any expression that is convertible to XPath booelan with boolean().
Default Value true()
Inheritance Rules If any ancestor node evaluates to false, this value is treated as false. Otherwise, the local value is used.

Many forms have data entry sections that depend on other conditions. For example, a form might ask whether the respondent owns a car. It is only appropriate to ask for further information about their car if they have indicated that they own one.

Through single node UI bindings, the relevant model item property provides information to the XForms user interface regarding visibility, focus, and navigation order. In general, when true, associated form controls should be made available for user interaction. When false, associated form controls (and any children) and group and switch elements (including content) must be made unavailable, removed from the navigation order, and not allowed focus. Typically, non-relevant user interface content is not presented, or it may be styled as disabled.

Example

XML CopyCode image Copy Code
<xforms:bind nodeset="/order/item/discount" readonly="true()" relevant="/order/item/amount &gt; 1000"/>

Specification

Link to the XForms specification: the relevant Property.