Data-binding for fun and profit

You'll be learning about data-binding in Mobilengine forms:

  • How to use query statements to make the values in a control dynamic - dependent on input in another control, or reference data in a database

This section is a detour of sorts. For a short while, you'll be leaving the exciting world of Rocky Jupiter to concentrate on data-binding itself, without any use case to distract you. When you get back to the admin webforms, you'll be prepared to streamline the Vehicle Inspection and jazz it up with a host of cool new features.

Data-binding is an essential feature of the Mobilengine form language. It is perhaps the single most useful technique a Mobilengine developer such as yourself can have.

The basic idea is that instead of hard-coding a specific value for a control, you put a reference into the control (aka bind the control to) to one or more properties of another control, to a reference table, or to a system parameter, and pull data into your control from them. You want to do this primarily because the data-bound control will always be up-to-date - its value changes in real time when the referenced resource changes

Data-binding is based on SQLite query syntax, with the most important difference being that unlike SQLite, it is strongly typed, which allows compile time type-checking. You won't need to be an expert on SQLite to use data-binding in Mobilengine solutions, but if you do get stuck at any point, an SQLite tutorial will definitely help. For specifics, see the comprehensive data-binding reference.