Binding Target

Top  Previous  Next

The binding target is an object affected by the binding. It can either be a widget component or some data within a AggreGate Server context. To affect a widget component, the binding target has to point to one of its properties. To modify context data, the binding target has to point to a context variable, field of a variable or the input field of a context function.

In fact, the binding target is a special type of reference. Two types of binding targets are supported: one with no schema (and thus, no prefix), which points to context data, and another, which uses the form schema and prefix (form/) and points to the widget component properties.

There are several supported forms of binding targets:

1. Specific Property

form/component:property

This binding target points to a specific property of a widget component.

Binding target that refers cell of the tabular property within the specific row and field has the following format:

form/component:property$field[row]

note_example-wt

Example: form/textField1

A binding with this target will write its result to the default property of the textField1 component. If textField1 is a text field, its text property will be changed.

note_example-wt

Example: form/image1:imageTable$imageData[0]

This binding target changes a binary image in the first row of Image component's Image Table.

note_example-wt

Example: form/gauge:datasets[1]

This binding target changes the value of a second dataset (with index=1) of a gauge component.

2. Server Context Variable

context:variable

This binding target points to the value of a context variable. Since a variable is always a Data Table, the binding expression must resolve to a Data Table in order to allow bindings processor to use this table as new value of variable.

note_example-wt

Example: users.admin:childInfo$firstname

This binging target will modify the firstname field of the childInfo variable for users.admin.

3. Field of Server Context Variable

context:variable$field

This binding target points to a specific field within a context variable. The actual value of the context variable will be changed just once during the bindings processing session, even if there are several bindings targets pointing to the fields of this variable.

note_further-wt

If there are two binding targets pointing to the same field of the same variable, only one will eventually be applied (the one appearing later in the widget's bindings table).

4. Context Function

context:function()

This type of target points to the function of a context. When a binding with such target is processed, that function is called. If some bindings pointing to the input fields of the function are processed within the same bindings processing session, the values produced by these bindings are used as the function input. Otherwise, the function is called with default input parameters.

5. Input Field of Context Function

context:function()$field

This binding target points to an input field of a context function. The actual function call will be performed just once during the bindings processing session, even if there are several binding targets pointing to various input fields of this function.

note_further-wt

If there are two binding targets pointing to the same input field of the same function, the function will eventually be called with only one of these as its input field (the one appearing later in the widget's bindings table) -- it won't be called twice.

6. Widget Script

form/script()

This type of binding target is used to launch the widget script named script upon processing the binding, passing the binding evaluation result to the script as its parameter. Bindings with such targets are created automatically upon adding new scripts to the widget template. However, initial properties of such binding does define any script launch conditions. It's necessary to modify these properties to make the script start on widget startup, some event or just periodically.

note_example-wt

Example: form/refreshChart()

This binding launches the refreshChart widget script that may refresh a chart component to make it displaying the most recent data.

7. Context Action

action/context:action

This target starts interactive execution of action action from context context. Binding evaluation result is passed to the action as an input value.

note_further-wt

Action execution is not available if widget is running as a standalone application (outside of AggreGate Client).

note_example-wt

Example: action/cardholders:import

Starts cardholders import action (Cardholders module is a part of Time and Attendance and Access Control solutions), that is an action named import in context with path cardholders.