Placing a filter on the collection doesn't work ?
Well, my data collection is not an ArrayCollection, but rather a custom DataDefinition class, which inherits from the DefaultDataDefinition class. I didn't see any filtering capabilities associated with that class, like there is with the ArrayCollection class.
1 person found this helpful
Um , okay , I'm guessing that is a custom class because I can't find it in the API. I would try to get an ArrayCollection in there somewhere , even if only as the result of a getter method. If I remember correctly , tree items have to have a "children" collection , try putting some filter logic in that. It's ugly and is just all around terrible but it might work. But like I said before , try use what the language gives you first and foremost.
Makes sense. I think I mis-typed above. Reade DefaultDataDescriptor class, instead of DefaultDataDefinition.
I went that route because it appears that the tree component handles those best (it conforms to the ITreeDataDescriptor interface), which provide it with the functionality it needs, along with the children property.
Using this makes it much easier to construct my hierarchical data set - at least this is the only solution I have been able to find that seems to work so far.
Okay , so the Value Object implements DefaultDataDescriptor , and the tree shows the VOs. Now what contains the VOs ?
Yes, you put it much better than I did. That's the situation. The VOs contain themselves. If a VO has children, it contains them as well. If not, then not. Presenting this object to the tree seems to work.
When constructing the VO from the data source, I recursively populate it with any children using the addChildAt() function inherited by the DefaultDataDescriptor.