OtfDataBinding

From emotive
Jump to navigation Jump to search

Data Binding

Data binding is the process that establishes a connection between the application UI and business logic. In other words, if an OTX Variable changes its value, the elements that are bound to the data reflect changes automatically and vice versa. For example, if the user edits the value in a TextBox control, the OTX Variable bound to the TextBox via a Screen Signature Parameter is automatically updated to reflect that change. And if the OTX Variable changes its value the content of the TextBox control will be updated immediately, see picture below.

OtfDataBinding.png
Data Binding - Bounds OTX variables to external devices such as GUI, DLLs etc.

Mapping

Data Binding requires a Mapping between OTX and the external data at Runtime. This mapping is applied to the parameters of the following signatures:

Mapping means that an external data, like the Text property of an Label control, is mapped to a Screen Signature IN-Parameter. An the Screen Signature IN-Parameter is bound to an OTX Variable of type String.

The main advantage of mapping is the clear separation between business logic and external data. And it is very easy to adjust in the OTF:

  1. Bind Variables to Signature Parameters
  2. Map the Signature Parameters to External I/O
Exclamation.png Important: But there is also one disadvantage: It cannot be evaluated events that are not associated with data, e.g. Button-Click event. In such cases a Variable of type Boolean should be bound to the button. Each click will change the value of that variable from False to True to False etc.
Mapping.png
Mapping - Integration of external data