Unfortunately, the term "binding" is very heavily overloaded. :-) What you are describing sounds like "data-bound" or "data-driven" controls. Pivot does support this - in fact, the design of this feature was somewhat inspired by Flex. The ListView, TableView, and TreeView components (among others) are all backed by instances of org.apache.pivot.collections.List. Implementations of this interface (such as ArrayList) fire events, which allow them to be used as a data model. You can see some examples in the tutorial:
http://pivot.apache.org/tutorials/ It currently only covers Pivot 1.5 but most of the concepts are the same in 2.0. Pivot also supports several other forms of binding: - BXML binding, which maps objects declared in markup to Java member variables - Data binding, which uses a load()/store() mechanism to populate user interface elements - Namespace binding, which allows you to declaratively create a relationship between a source property and a target property (also inspired to some extent by Flex) Hope this helps. Greg On Oct 19, 2010, at 10:17 AM, Gerrick Bivins wrote: > Hello all, > I'm coming from a dev background of swing then a flex project and now we are > back on a java project. > After my experiences with flex/actionscript I've been looking for a more > modern alternative to swing so > that lead me to pivot. > Right now I'm struggling with understanding data binding in pivot (I'm using > trunk of 2.0). > In flex/actionscript, just about any thing (components, data) were > "bindable". What that allowed was the ability to > populate a bindable structure (arraylist for instance) and then refer to > that arraylist as the "dataprovider" for any of > the components. Changes to the arraylist are automatically reflected in any > components that were bound to it. > That's the general idea but it's a pretty vague description/example. Here is > an example from the docs that shows an arraylist as a dataprovider to a table > (datagrid): > Data binding in a flex datagrid > > This paradigm was one of the great things about flex/actionscript and I was > hoping pivot had some similar mechanisms in place but > I can't find a concrete example of it. Is there an analogous "databinding" > concept in pivot? > > Thanks for any guidance here. > Gerrick >
