[Seaside] Generalizing WATree Update--it works..

Tim Murray tmurray at ecsorl.com
Wed Aug 18 17:47:30 UTC 2010



First off, apologies to the list for using separate subjects, but if I
respond to my original thread it messes up the list formatting.


For the specific instance of CFileDirectoryTreeItems, I was able to
generalize the WATree component to render a display of my File system.


Per my previous update, the rendering of children failed because a call
to isExpanded in WATree failed because the search in the IdentitySet

Returned false. Even though and instance of CFileDirectoryTreeItem was
in there. I suspect this has something to do with the Tweak branch of


I wanted to stick with this, because the Tree functionality I want is
already in place -getChildren, getLabel, etc.


My solution:


I subclassed WATree as WACFileDirectoryTree and replaced the IdentitySet
with a Dictionary so that I could use the Label of a node

As a key and store the object as a value for that key-thereby bypassing
the object/class equality voodoo.


I over-rode four methods:



            super initialize.

            expanded := Dictionary new.

            self selectBlock: [ :node | self answer: node ].

            self childrenBlock: [ :node | Array new ].

            self labelBlock: [ :node | node greaseString ]


expand: aNode

            expanded add: (aNode getLabel)->aNode.


expandAll: aCollection

            aCollection do: [:n | self expand: n].


isExpanded: aNode

            ^expanded includesKey:  (aNode getLabel)




I now can expand my tree and it renders!


Next up is to make sure all other WATree functionality works; however,
now that I have a handle to actual objects, It should be doable.




Hope it helps somebody.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100818/8245f4aa/attachment.htm

More information about the seaside mailing list