views:

594

answers:

0

Hi,

I have a main class ClassA that has a bunch of "normal" properties that are simple datatype like ints, strings, etc. It also has one property ("childItems") that is an ArrayCollection of ClassB.

I am using an ArrayCollection of ClassA as the source for an hierarchical data provider for an AdvancedDataGrid. I set the childrenField to "childItems".

I want to display some information about the list of ClassB objects in a nested table and pie chart, so I configure an AdvancedDataGridItemRendererProvider (columnIndex = 0, columnSpan = 0, depth = 2) and point it to my custom renderer which is an HBox with the table and the pie chart in it.

In order to see what is being set, I override the "set data" function in my custom renderer and what I see is that each instance of ClassB in the ArrayCollection is passed to the renderer separately.

Here is my question: I expected the whole ArrayCollection of ClassB instances to be passed to the custom renderprovider once and not each item in the child list individually. How do I make the ADG understand that the whole property is supposed to be passed as the data to the renderer and not each entry separately?

Btw, when I change the data type of "childItems" from ArrayCollection to ArrayList, the whole list gets passed and I can easily do what I want to do. But based on my understanding, ArrayList is not really supposed to be used and ArrayCollection is better or at least more common.

Any insights on that would be appreciated.

Thanks!