This property sets and gets the 'method' attribute of the binding. The default bind
method varies depending on the data source and the capabilities of the data source
(for example whether or not it is read only, or whether or not it has sufficient
means of providing data change notifications to the binding framework). The values
can be:
- oneTime - The data flows from the source to the target once upon
instantiation of the binding. Subsequent changes to the data do not affect
the value of the user interface element.
- oneWay - Data flows only from the source to the target on demand, or when
data changes.
- twoWay - Data flows from the source to the target, and can return to the
source (bi-directional) on demand or when data changes.
function onSample()
{
var sourceBox = scene.getBoxById("mySourceBox");
var box = scene.getBoxById("myBox");
if (box && sourceBox)
{
var binding = box.getDataBinding("myBinding");
if (binding)
{
binding.elementSource = sourceBox;
binding.path = "value";
binding.bindMethod = "twoWay";
binding.connect();
}
}
}