Since Wicket's TreeTable uses Java's javax.swing.tree.TreeModel, I would check out Oracle's tutorial on How To Use Trees (JTree).
More precisely the Dynamically Changing a Tree section: http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html#dynamic See if that helps you. ~ Thank you, Paul Bors -----Original Message----- From: lxw_first [mailto:[email protected]] Sent: Friday, August 10, 2012 3:38 AM To: [email protected] Subject: How to update the treetable I created a treetable with a treemodel based on database schema. I am trying to refresh the treetable so that it will change it's data after some db update. I update viat the button event.the button event work but treetable doesn't change. To create treetable i have this on my page: treeTable = new TreeTable("treeTable", createTreeModel(), columns); treeTable.getTreeState().setAllowSelectMultiple(true); treeTable.setRootLess(true); treeTable.getTreeState().collapseAll(); creatForm.add(treeTable); the createTreeModel code: protected TreeModel createTreeModel() { DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(); initTree(roleList, rootNode); TreeModel treeModel = new DefaultTreeModel(rootNode); return treeModel; } i add the button event like this: protected void onSubmit(AjaxRequestTarget target, Form<?> form) { roleList.clear(); treeTable.updateTree(target); target.add(getForm(),treeTable); } Any idea or reference to documentation that explain this? thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-update-the-treetable-tp465 1122.html Sent from the Users forum mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
