Hi Greg,
Where my confusion comes in is in the syntax, I think,
What I was expecting to be able to specify the dataprovider something like
this:
in BXML:
<Border>
<content>
<ScrollPane horizontalScrollBarPolicy="fill_to_capacity">
<view>
<TableView bxml:id="tableView" tableData="*$**
tableDataInList*">
<bxml:define>
</bxml:define>
<columns>
<TableView.Column name="label" width="3*"
headerData="Name"/>
<TableView.Column name="value" width="1*"
headerData="Value"/>
<TableView.Column name="units" width="1*"
headerData="Units"/>
</columns>
</TableView>
</view>
<columnHeader>
<TableViewHeader tableView="$tableView"/>
</columnHeader>
</ScrollPane>
</content>
</Border>
And with a definition of *tableDatainList *defined and populated somewhere,
bxml,java,javascript etc, as a bindable variable.
Is it possible to define a List somewhere and then bind it as a variable
that is accessible in bxml?
Again thanks for the patience here.
Gerrick
On Tue, Oct 19, 2010 at 12:16 PM, Greg Brown <[email protected]> wrote:
> 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<http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf66ce9-7ff2.html#WS2db454920e96a9e51e63e3d11c0bf66ce9-7fee>
>
> 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
>
>
>