You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

Data Binding

Data Binding in Structr means connecting user interface elements to database objects. The binding is done by specifying a query and a keyword that can be used in a Template Expression to access the result objects. The UI element will then act as a repeater (see Repeater Elements).

Besides the custom user-defined keywords, there are pre-defined keywords such as current, me or page to access context and system data.

Search results for "Data Binding"

Widgets

When dragging a Widget into a page, a new set of DOM elements is created as child nodes of the node the Widget was dropped onto, including metadata defined in the Widget source like data binding and queries. The textual information contained in the Widget is transformed into database elements (nodes, relationships and properties) as well.

Data Binding

The use of the data binding flyout and its functionality is not recommended, it is deprecated and will be removed in a future release.

The Data Binding flyout provides functionality to create repeater elements via drag-and-drop. After selecting a type, you can drop a special element into the page preview to create a repeater element for the corresponding type. Or you can drop one of the property elements shown in the flyout to replace the text of a content element with a template expression that references the corresponding property.

Query and Data Binding

The Query and Data Binding Dialog provides access to the repeater configuration. You can select a data source for the repeater, which can either be a flow, a REST query, a Cypher query, an XPath query or a Function expression (called Function Query in this dialog).

In the context of this article, we will always use the same basic example: We will list the available projects in the database sorted by name. In each iteration the current element is made available via scripting as the defined data key (proj in these examples). Building on this, more complex data bindings can be created.

Flow

The flow repeater selector lists all available flows. The return value of the selected flow is used for data binding.

Custom Properties