I’ve been trying to get a Tree component working and
had problems with ajax
node expansion. A bit of debugging showed me that the problem was the
enclosing form. In a form, PartialForBean.getData(IRequestCycle, IForm)
method creates a cache of the elements and returns that cache. For a
Tree, it iterates over the original nodes and leaves the iterator at the end of
the stack. It then returns the persisted copy. This method is
called in PartialForBean.renderComponent(..). However, on line 178 (in
beta2), the PartialForBean calls getPartialBlock().getPartWriter(). The
partial block is the Tree component. Tree.getPartWriter(..) looks at the
state of the original TreeIterator – which is left at the end of its
list. Thus, the depth and previousDepth are usually wrong.
I kludged around this by cloning the html/jwc files from the
Tree and set the PartialFor’s volatile property to true. It’ll
keep me in business for now, but it’s probably not a good solution.
Perhaps the bigger brains around here can come up with a better one.
-Steve
|