Hi all!
I have problem with rerendering tree component after child delete. Im trying to do a lazy loading tree with add, move, rename...functionality. It partikulary works, but removing doesnt.
A part of view:
<a4j:outputPanel id="treeOutput">
<rich:tree value="#{SessionBean.fileTree}" var="item" nodeFace="directory" id="fileTree">
<rich:treeNode type="directory">
<a4j:commandLink value="#{item.dirName}"
action="#{SessionBean.treeNodeClicked}"
actionListener="#{item.nodeClicked}"
reRender="listPanel,treeOutput,infoPanel" />
</rich:treeNode>
</rich:tree>
</a4j:outputPanel>
<a4j:commandButton alt="Delete" action="#{SessionBean.directoryDeleteClicked}"
reRender="treeOutput" />
private DirectoryNode rootNode;
public TreeNode getFileTree(){
return (TreeNode)this.rootNode;
}
public String directoryDeleteClicked(){
Directory directory = this.selectedDirectoryNode.getDirectoryObject();
this.rootNode.removeChild(directory.getId().toString());
directory.getParent().getChildren().remove(directory);
this.applicationBean.directoryLocal.delete(directory);
return null;
}