cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@s-und-n.de
Subject expanded tree onpageload
Date Wed, 02 Aug 2006 08:57:55 GMT
Hi,

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?

model.xml:
<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
DefaultTreeModel
      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 =
(TestSession)ObjectModelHelper.getRequest(objectModel).getSession().getAttribute("TestSessionContext");
            testBean = testSession.getTestBean();  //includes all the data
which are needed
            treemodel = new TreeData(testBean);
            root = (DefaultTreeNode)treemodel.getRoot();
            builtTree();
      }

      public void builtTree(){
            this.setModel(treemodel);

            //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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message