This property sets and gets the method to determine when data is transferred
between the target and the source. Valid values are:
- onDataChanged - Data is transferred when
the data source fires a data change event (default)
- onDemand - Data transfer will occur only on explicit calls to update() on
the binding object
- onBlur - This value is only relevant for some data sources, but generally it
is interpreted as data flowing from the data source on initial update or on
demand and data flowing to the data source when the element loses focus.
(Note: Currently this value is not supported.)
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.updateMethod = "onDataChanged";
binding.connect();
}
}
}