Note that there are some explanatory texts on larger screens.

plurals
  1. POExpanding Wickets TreeTable nodes when initializing a tree
    primarykey
    data
    text
    <p>I'm pretty new to wicket and I'm trying to create a simple wicket tree that holds information about mailinglists. This mailinglist is related to a certain letter.</p> <ul> <li>MailingListDto 1 <ul> <li>User 1</li> <li>User 2</li> </ul></li> <li>MailingListDto 2 <ul> <li>User 3</li> <li>User 4</li> </ul></li> </ul> <p>If we are editing an existing letter, the mailinglists related to that letter are fetched <code>into mailingListCollection</code> and the corresponding nodes on the tree should be selected and expanded. For some reason I don't seem to get this workin.</p> <p>The selected and expanded nodes do not show as selected nor expanded in the UI, but if I go through the selected nodes programmatically for example in <code>onAfterRender()</code> and log the selected and expanded values, the nodes are expanded and selected.</p> <pre> tree = new TreeTable("treeTable", treeModel, treeColumns) { @Override public void onBeforeRender() { super.onBeforeRender(); if (!mailingListCollection.isEmpty()) { for (MailingListDto mailingList : mailingListCollection) { tree.getTreeState().expandNode(mailingList); tree.getTreeState().selectNode(mailingList, true); } } tree.updateTree(); } @Override protected void onAfterRender() { super.onAfterRender(); if (LOG.isDebugEnabled()) { LOG.debug("onAfterRender: " + tree.getTreeState().getSelectedNodes().size()); for (Object obj : tree.getTreeState().getSelectedNodes()) { LOG.debug(tree.getTreeState().isNodeSelected(obj) + " " + tree.getTreeState().isNodeExpanded(obj)); } } } }; tree.setRootLess(true); tree.getTreeState().setAllowSelectMultiple(true); add(tree); </pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload