I'm using the rich:tree component and I noticed different behaviour between RichFaces 3.0.0 and RichFaces 3.0.1RC2.
I need to perform some operations with my tree: Add a new node, remove a node, drag & drop in the same tree.
With RichFaces 3.0.0 I could easily add and remove nodes without a lot of code using the removeChild
method of my TreeNode implementation. It worked well.
With RichFaces 3.0.1RC2 I can't delete a node anymore with the same code.
With IE I always get a JavaSript error (but the tree is rendered) and with Firefox I get the debug page...
<a4j:outputPanel layout="block" id="treePanel" ajaxRendered="true"> <rich:tree name="adminTree" style="width:300px" value="# {TPZAdminTreeBean.data}" var="item" nodeFace="#{item.type}" ajaxSubmitSelection="true" switchType="ajax" dragIndicator="indicator" dragValue="#{item}" dragType="#{item.type}" dragListener="#{TPZAdminTreeBean.processDrag}" dropValue="#{item}" dropListener="#{TPZAdminTreeBean.processDrop}" acceptedTypes="OTU" > <rich:treeNode value="item" ajaxSubmitSelection="true" id="adminDomainNode" type="DOMAIN" }" reRender="treePanel"> <h:outputText value="#{item.resource.name}" /> <a4j:commandButton ajaxSingle="true" image="/view/images/Clear16.png" immediate="true" action="#{TPZAdminTreeBean.deleteNode(item)}" reRender="treePanel"/> </rich:treeNode> <rich:treeNode value="item" id="adminOtuNode" ajaxSubmitSelection="true" type="OTU" reRender="treePanel"> <s:link value="#{item.resource.name}" target="DetailWindow" action="#{TPZAdminTreeBean.forwardToDetailPage('OTU')}" onclick="openDetailWindow ('../detail/otu/TPZNOCDetailOTU.seam')"/> </rich:treeNode> </rich:tree> </a4j:outputPanel> public String deleteNode( TPZTreeNode node ){ ... data.removeChild( resource ); ... return ""; }