7 Replies Latest reply on Apr 29, 2007 3:09 PM by Nick Belaevski

    Tree error

    Alexander Belov Novice

      I use Tree component with switchMode="client". There is an Exception when I click a4:commandLink on the same page outside the Tree.

      Exception:

      java.lang.UnsupportedOperationException
      at java.util.Collections$SingletonSet$1.remove(Collections.java:3086)
      at java.util.AbstractCollection.clear(AbstractCollection.java:422)
      at org.richfaces.renderkit.TreeRendererBase.encodeAjaxChildren(TreeRendererBase.java:170)
      at org.ajax4jsf.ajax.repeat.UIDataAdaptor.encodeAjaxChild(UIDataAdaptor.java:361)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:139)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:97)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:150)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:97)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:150)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:97)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:150)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:97)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:150)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:97)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:150)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:97)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:150)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:97)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:150)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:97)
      at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:150)
      at org.ajax4jsf.framework.renderer.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:125)
      at org.ajax4jsf.framework.ajax.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:536)


      Page code:

      ...
       <rich:toolBar itemSeparator="disc" rendered="#{!empty treeBean.currentLayout}" id="toolbar">
       <a4j:commandLink oncomplete="Richfaces.showModalPanel('#{treeBean.modalPanelComponentClientId}')"
       value="add" action="#{treeBean.addData}"
       reRender="#{treeBean.toolbarUpdate}"
       id="addData" limitToList="true"/>
       <a4j:commandLink oncomplete="if(data){Richfaces.showModalPanel('#{treeBean.modalPanelComponentClientId}')}"
       value="edit" action="#{treeBean.editData}"
       reRender="#{treeBean.toolbarUpdate}"
       data="#{treeBean.showPanel}"
       id="editData" limitToList="true"/>
       <a4j:commandLink oncomplete="if(data){Richfaces.showModalPanel('#{treeBean.modalPanelComponentClientId}')}"
       value="delete" action="#{treeBean.deleteData}"
       data="#{treeBean.showPanel}"
       reRender="#{treeBean.toolbarUpdate}"
       id="deleteData" limitToList="true"/>
       </rich:toolBar>
      
       <a4j:region>
       <h:panelGrid binding="#{treeBean.tableDivComponent}" id="tableDiv" columns="1">
       <f:facet name="header">
       <h:outputText value="#{treeBean.tableTitle}" id="tableTitle"/>
       </f:facet>
       <rich:tree value="#{treeBean.data}" nodeFace="item" var="value"
       binding="#{treeBean.tableComponent}"
       nodeSelectListener="#{treeBean.selectListener}"
       switchType="client">
       <rich:treeNode type="item">
       <h:outputText value="#{value.value}"/>
       </rich:treeNode>
       </rich:tree>
       </h:panelGrid>
      ...


      Method toolbarUpdate returns List with only one item: id of modalPanelComponent.