I am using a rich:tree to display a large amount of data in my application. Each node has a considerable amount of HTML along with drag and drop support for reordering.
My problem is that when I drop a node into another, it seems that I have to re-render the whole tree. Is there a way I can chose which nodes to render. since re-order affects only certain nodes, re-rendering the whole tree seems to be unnecessary.
<rich:tree toggleType="ajax" var="node" id="segmentTree"
nodeClass="rich-node-class" handleClass="abc" iconClass="cde"
labelClass="node-lbl">
<rich:treeModelRecursiveAdaptor
roots="#{segmentationBean.treeAsList}" nodes="#{node.children}">
<rich:treeNode id="treeNode" styleClass="treeNode" expanded="#{node.expanded}">
<rich:dropTarget acceptedTypes="segments" dropValue="#{node}"
render="segmentTree"
dropListener="#{segmentationBean.onSegmentReorder}"
oncomplete="initializeTree();" />
</a4j:outputPanel>
</rich:treeNode>
</rich:treeModelRecursiveAdaptor>
</rich:tree>
Some more info: If i just try to render the "treeNode" the I see a NPE TreeRenderingContext:
public static TreeRenderingContext get(FacesContext context) {
return (TreeRenderingContext) context.getAttributes().get(ATTRIBUTE_NAME);
}
This method returns null for ATTRIBUTE_NAME = "org.richfaces.renderkit.TreeRenderingContext:ATTRIBUTE_NAME". Any help would be greatly appreciated. Thanks.