Mobile Form Expression Requirements and Restrictions

Follow these requirements when you define a mobile form expression:

Requirement

Guidance

Reference an element property

Reference at least one element property, such as status.value or this.value. The referenced properties determine when the expression runs again.

Keep structural properties static

Don't define expressions for type, multiple, or parent. These properties determine the form structure and stored data shape.

Changing these properties at runtime can cause the client form and synchronized server data to disagree.

To present different structures conditionally, create separate elements and control visibility with the hidden property.

Return the expected data type

Return a value for hidden, disabled, required, and readonly.

Return a string for label, placeholder, class, and text.

Return an of option objects for options.

For value, return the data type required by the element.

Note:

Returning a different data type can result in invalid or unexpected form behavior.

Use valid JavaScript identifiers

Element names and custom property names can contain letters, numbers, underscores, and dollar signs. A name cannot begin with a number. For example, use safety_check instead of safety-check.

Return consistent results

The same input values should always produce the same result. Base the result only on referenced values and return it synchronously.

You can use methods such as Math.round that produce the same result from the same input. Don't change another element, manipulate the browser Document Object Model (DOM), make an HTTP request, or start asynchronous work.

Note:

Don't use window, document, timers, or network functions because these browser APIs are not supported as expression dependencies.

Related Topics

General Notices