
Mutual data binding enables interaction between UI elements and context elements. The view, which contains the UI elements, is always bound against the context of its assigned controller. If a data binding of context element and UI element property is defined, the changes of the UI element property are directly transferred to the context and vice versa. These changes are also adopted by the properties of other UI elements of the same view if the are bound to the same context element. More complex UI elements - for example, the Table UI element or Tree UI element - can be bound to a context node that represents a collection. Therefore, these UI elements can display the complete data and content of the node.
By storing a reference to a context element, data can be passed directly from the context to the UI element and back. This reference is created by specifying an entry that is similar to a path - for example, MonthsOfYear.MonthName - as a value of a bindable UI element property. A period separates the individual context elements - for example, MonthsOfYear.MonthName. See Code Examples for Data Binding .
The SAP NetWeaver Developer Studio provides graphical support of the context elements and allows application developers to assign the context nodes and context attributes to the corresponding UI element properties. This means that the data transport between the context element and the UI element does not require an explicit implementation.
There are different data binding concepts for the individual UI elements. The following general rules apply:
Note that the IDs of the UI elements are not bound. The same applies to these properties that represent the names of an action and can be executed when an event occurs - for example, CheckBox.onToggle.
Certain properties, however, can be bound to any type of the context attribute if they are defined as convertible. These include:
All other properties can only be bound to a context attribute of the same data type.
The checkbox group UI element can be bound, for example, to the context attribute MonthName of the context node MonthsOfYear using the bindTexts property.
The CheckBoxGroup UI element stores the reference to the context attribute. Therefore, it automatically receives the context values and can overwrite the context with new values. The application developer can initializes the value of the context attribute in the wdDolnit method.