cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject expanded tree onpageload
Date Wed, 02 Aug 2006 08:57:55 GMT

i'm trying to implement an treeview which is still expanded when the page
is loaded but i can't get it.

At the moment, the tree is closed and via Ajax the nodes expand or
collapse. That works fine.
But i want the tree to be expanded completly.

Is this possible in some way?

<fd:tree id="testtree" root-visible="true" selection="multiple">
      <fd:tree-model type="java" class="test.TestTree"/>

class TestTree:
public class TestTree extends Tree implements TreeModel,Contextualizable {

      private TreeData treemodel = null;         //TreeData extends
      private TestSession testSession = null;
      private TestBean testBean = null;
      private Map objectModel;
      private DefaultTreeNode root = null;

      public void contextualize(Context context) throws ContextException {
            objectModel = (Map)ContextHelper.getObjectModel(context);
            testSession =
            testBean = testSession.getTestBean();  //includes all the data
which are needed
            treemodel = new TreeData(testBean);
            root = (DefaultTreeNode)treemodel.getRoot();

      public void builtTree(){

            //how to expand all the nodes?


class TreeData:
public class TreeData extends DefaultTreeModel

//Builds the DefaultTreeNodes getting the needed data from the testBean.
This works fine!

Any ideas?

With kind regards
Fabian Hagen

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message