|
Re: How to update a tree in a tree field? [message #1553506 is a reply to message #1553047] |
Thu, 08 January 2015 13:50  |
Eclipse User |
|
|
|
After some discussion with a colleague, a possibility is to set build a new Tree and to set it:
public void refreshTree() throws ProcessingException {
//Selection Key:
Object key = null;
if (getTree().getSelectedNode() != null) {
key = getTree().getSelectedNode().getPrimaryKey();
}
//Fetch the LookupRows:
SomeLookupCall call = new SomeLookupCall();
List<? extends ILookupRow<Long>> lookupRows = call.getDataByAll();
//Build the Tree:
ITree tree = new Tree();
setTree(tree, false);
tree.removeAllChildNodes(tree.getRootNode());
P_TreeNodeBuilder builder = new P_TreeNodeBuilder();
List<ITreeNode> children = builder.createTreeNodes(lookupRows, ITreeNode.STATUS_NON_CHANGED, true);
tree.addChildNodes(tree.getRootNode(), children);
tree.selectNode(tree.findNode(key));
tree.expandAll(tree.getRootNode());
}
|
|
|
Powered by
FUDForum. Page generated in 0.03432 seconds