Examples of using Data binding
This page shows how to create a data binding source using Courier Editor and how to configure data binding using Scene Composer. As an example, an Industrial solution will be used.
1. Creating a Data binding source
First, create a new Data binding source using the Courier Editor.
Open the Industrial solution from the Samples and Templates section of Scene Composer Startup panel.

From [ File > Define application specification ] on the Scene Composer menu bar, open the "Courier Editor Parameters" dialog, and select [ Edit... ] to start CourierEditor.

A CourierEditor window opens. From the menu bar, click [ File > New ].

The "New File" dialog box will open, so set the save destination and name for the new data binding source and click [ Save ].

These steps create a new Data binding source.

Add Data binding items (data name/type) to the created Data binding source.
- Click the [ + ] button on the Binding Sources tab. "[0] bindingSource" is added.

- [0] Click on bindingSource to view the content and set name to "Industrial".

- Click the [ + ] button for items and click [ Add new item ]. "[0] item" is added.

- Set "[0] item" to:
name = Temp
type = FeatStd::Int32

The creation of the data binding source is now complete. Save by selecting [ File > Save ] from the menu bar.
Please refer to Courier Editor for more information on how to create data binding sources.
2. Linking Data binding source to Scene Composer
Link the Data binding source with Scene Composer. Open the "Courier Editor Parameters" dialog from [ File > Define Application Specification ] on the Scene Composer menu bar. In the Specification File Selection and Search Path dialog, set the save destination for the data binding source in [ File: ], and click [ OK ].

3. Configuring Data binding using the Scene Composer
Set up data binding to any property using the Scene Composer. Configure data binding using the chain icon on the far right of any property in the Properties panel.
For more information about data binding, please refer to Data Binding.
In the scene tree of the Scene1_Main scene, select [ GauegeTemperature ], and in the properties panel, click the [ Control > Value ] chain icon. The Define Data Binding dialog opens. Select "Industrial > Temp (FeatSte::Int32)" from the data item and click [ OK ].

When data binding is set, the color of the chain icon changes to blue.

4. Operation confirmation using Live Preview panel
You can check the operation of data binding settings in the live preview panel.
Display the live preview panel from [ View > Live Preview ] on the Scene Compsoer menu bar, and set the [ On/Off ] button at the top right of the panel to "On".

Set the Needle (Variant) value to your desired value. Confirm that the position of the thermometer needle displayed in the scene editor changes to match the value you set.
