!--a11y-->
Defining
Data Binding 
Data binding stands for the connection of a UI element property as a data drain with a data source that is stored in the controller context. A context path must be declared for this connection.
The previously described procedures - for example, the definition of the individual context structures and the creation of different UI element properties - have made all necessary preparations to allow you to declare several data bindings in an easy way.
The procedure for the data binding of a single UI element property is as follows:
1. Select the layout tab of the View Designer
2. Select the UI element properties in the Properties window
3. Select the property in the Properties tab
4.
Choose the
button at the right edge of the Value
column
5. Select the value attribute to which the property is to be bound in the subsequent dialog box
6. Confirm the selection and exit the dialog box choosing OK
In the Value column, the entry of the context path for the selected value attribute is displayed - for example, <context value attribute name> for the top level value attribute that is located directly below the root node or <context value node name>.<context value attribute name> for value attributes that are assigned to an independent value node.

Use the description above to define the following data bindings in the three views Welcome, Question, and Answer:
UI Elements of the View |
Property |
Context Path |
View Welcome |
||
TextMessage |
Text |
TextMessage |
ExitButton |
Properties of Button - visible |
ExitButtonVisibility |
View Question |
||
QuestionCounter |
Properties of TextView - text |
Counter |
NextQuestionButton |
Properties of Button - visible |
NextButtonVisibility |
QuestionText |
Properties of TextView - text |
Question |
View Answer |
||
AnswerText |
Properties of TextView - text |
Answer |
.

UI elements whose events are bound to declared actions - for example, the event onAction for the Button UI element - can also be controlled without data binding of the property enabled to a context attribute of the type boolean.
These UI elements are activated or deactivated at runtime when the state of the corresponding action object wdThis.wdGet<Action Name>Action() changes in the view controller using the method setEnabled(boolean). Therefore, all UI elements bound to this action are automatically activated or deactivated on the user interface.
After the declarative description of the data
binding, you can continue with the initialization of the
defined contexts and the customizing of the context contents in case
of state changes.
