java - Expanding Wickets TreeTable nodes when initializing a tree -


I am totally new to the wicket and I am trying to create a simple wicket tree which keeps information about the mailing list.
  • User 2
  • This mailing list is related to a certain letter.
  • Mailing list 2
    • User 3
    • User 4
  • if If we are editing an existing letter, then the mail list related to that letter is brought in the mailing list collection and the related nodes of the tree should be selected and extended. For some reason I do not seem to do this work.

    Selected and extended nodes do not appear in the UI, and do not appear expanded, but if I select the opener () and selected and expanded values ​​through selected nodes program , Nodes are expanded and selected.

     Tree = New Treatable ("Treatable", Tree Miodel, Tree Column) {@Override First Runner on Public Zero (Superior) {Super. Repeater (); (Mailing List Collection: Mailing List Collection) for {{Mail} list (collection): ISPT (). {Tree.gettreast () Extension node (mailing list); Tree.getTreeState (). Selection node (mailing list, true); }} Tree.updateTree (); } @ Override Protected Zero ContributorRenderer () {super.onAfterRender (); If (LOG.isDebugEnabled ()) {LOG.debug ("onAfterreender:" + tree.getTreeState (). GetSelectedNodes (). Size ()); (Object obj: tree.getTreeState (). GetSelectedNodes ()) {LOG.debug (tree.getTreeState (). IsNodeSelected (obj) + "+ tree.getTreeState (). IsNodeExpanded (obj))}}}} ; Tree.setRootLess (right); tree.getTreeState () setAllowSelectMultiple (right); 

    < P> To extend the root node of your tree:

      object RootObj = myTree.getModelObject (). GetRoot ();. MyTree.getTreeState () expandNode (rootObj);  

    To extend the first child of the root node, add the following line to the previous one:

      myTree.getTreeState (). ExpandNode (myTree GetModelObject (). GetChild (rootObj, 0) );  

    Note that you must extend the nodes of all the parents of the "target" node on the screen or else the target nodes will be hidden due to collapsing parents.

    < / Div>

    Comments