Hi Greg, I'd like the table to display each "A" property for class B or class C in a row. The columns would be the properties of A. If an instance of B is bound to the table, the table would look like this (assuming propb1 == 0, propb2 == 1)
name | property ------------------------- propb1 | 0 ------------------------- propb2 | 1 So the table knows how to display n# of "A" properties of Beans B or C in rows. Does that make sense? Gerrick On Thu, Dec 23, 2010 at 11:51 AM, Greg Brown <[email protected]> wrote: > In this scenario, what columns are you trying to display in your table, and > what class would you be using for your row data? > > On Dec 23, 2010, at 12:11 PM, Gerrick Bivins wrote: > > > Hi all, > > I have another question about data binding. Let's say I have a java Bean > which contains some other Beans as it properties. > > For example( not the exact code but I tried to simplify for this > example): > > > > //base Bean > > class MyBaseBean > > { > > //custom class that contains some base functionality for handling > change/veto events of beans > > // but not listed here to try and simplify the example > > } > > > > class A<T extends Number> extends BaseBean{ > > T getProperty(); > > void setProperty(T property) throws VetoException; > > String getPropertyName(); > > void setPropertyName(String name) throws VetoException; > > } > > > > class B extends MyBean > > { > > A propb1; > > A propb2; > > ... > > A getPropb1(){...}; > > void setPropb1(A pb1) throws VetoException{...}; > > > > A getPropb2(){...}; > > void setPropb2(A pb2) throws VetoException{...}; > > ... > > } > > and some other similar Beans > > ... > > class C extends MyBaseBean > > { > > A propc1; > > A propc2; > > ... > > A getPropc1(){...}; > > void setPropc1(A pc1) throws VetoException{...}; > > > > A getPropc2(){...}; > > void setPropc2(A pc2) throws VetoException{...}; > > ... > > } > > > > What I'm trying to do is display the data of class C and B in a table > without having to write a separate table for each. Seems like I should be > able to accomplish this > > since to display classes C and B I just need to drill down to each of > their properties of type "class A" and pluck the data off each property for > the row. > > In Flex (sorry for the reference but it's the world I'm coming from), I > could define a callback function that gave access to the bound object and > the row,column index of > > the table, which allowed me to get at the appropriate data for the cell. > > > > I tried looking through some of the binding tutorials and most of them > described how to use what I call the "dot notation" to set up the bindings, > > which works if I want to create a separate table for each class (C and > B). > > I can't claim to fully understand the *BindMapping functionality in Pivot > yet so maybe I'm missing something there. > > Thanks for any pointers/help here. Hopefully my question is clear enough. > > Gerrick > > > >
