Binding References

Top  Previous  Next

Binding expressions in widgets may include two types of references:

Standard references that point to context variables or functions, their fields or properties, and
Component references that point to properties of widget components.

Standard References

Standard references may resolve to one of the following:

A Data Table representing the value of a context variable of the output of a context function
The value of a single cell in this Data Table
The value of a certain property of the variable's or function's definition (e.g. the description of a variable)
The value of a certain property of a field within the Data Table (e.g. field description)

More information about standard reference format and resolving algorithm may be found in the Standard References section.

Component References

A component reference points to a property of a widget component (e.g. the text of a Label). It has the following format:

form/component:property

form is the name of the schema used to identify component references. It tells the expression language processor to use a resolver that understands component references and knows what to do with them. You always have to start component references with form/.

component is the name of the widget component you want to work with. The component name is shown in Resource Window and in the title of the Component Properties Window when the component is selected in GUI Builder.

property is the name of a specific property within the component. Property names can be found in the description of properties of every widget component. Property part of a component reference is optional. If it is omitted, the reference points to the default property of the component.

Type of property, i.e. type of value returned by a component property reference, may be found in the description of this property in the components reference.

Examples

{users.admin:childInfo$firstname}

{.:childInfo$firstname}

{childInfo$firstname}

If the widget's default context is users.admin, these three references will point to the same value -- Admin's first name. The first one uses a fully-qualified syntax with an absolute context. The second one has a relative context path, ".", pointing to the default context. In the third reference, the context is not specified at all, so it also points to the default context. All three bindings refer to the firstname field of the childInfo variable.

{form/userNameField:}

{form/userNameField:text}

Both of these two references resolve to the text currently contained in userNameField (assuming that's a text field). The first variant points to the default property of component, which is text, and the second one names it explicitly (:text).