THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- PIVOT-568 Add support for dynamic data binding
Pivot 1.5 and earlier supported data binding via a load/store model that maps well to client/server applications such as REST clients. However, a more dynamic model, where a property of a target element is automatically updated whenever a source value changes, is also useful in many circumstances.
Pivot 2.0 adds support for declaratively creating such dynamic binding relationships as well as the ability to define them in code. For example, the following markup creates a binding association between a page variable named "myText" and the "text" property of aLabel
instance:
...
<Label text="${myText}"/>
- . Any time the value of "myText" changes, the value of the label's "text" property is also updated
...
- :
Code Block | ||||
---|---|---|---|---|
| ||||
<Label text="${myText}"/> |
- PIVOT-546 Bindable improvements
TheBindable
interface allows a caller to easily associate Java code with markup defined in BXML. It defines a single method,initialize()
, that is called on the root element of a BXML document once the document has been completely loaded.
ThoughBindable
was actually introduced in Pivot 1.5, it did not provide all of the information an implementing class might need. Pivot 2.0 adds arguments containing the serializer's namespace, resources, and location, to theinitialize()
method. Any@BXML
annotations defined on theBindable
class are also processed prior to the call toinitialize()
. This allows the implementing class to get access to the document's namespace (i.e. page variables), the resources that were used to load it, and the location it was loaded from, to perform any necessary post-processing (for example, registering event listeners).
...