4 Replies Latest reply on Jul 24, 2009 12:24 PM by Nick Belaevski

    UITree method not implemented --

    Brian Antao Newbie

      Hello,
      The following UITree method in 3.3.0
      does not have an implementation and throws an Unsupported Operation exception.
      The 3.3.1 release notes do not indicate that this method had been implemented.

      public void updateSelectedNode( UITree tree) {
      TreeNode selectedNode;
      Object key = tree.getTreeNodeRowKey(selectedNode);
      TreeRowKey newCurrentRowKey = (TreeRowKey) key;
      tree.setRowKey(newCurrentRowKey);
      }

      The method "getTreeNodeRowKey" lacks an implementation for sure ... not sure about the
      method "setRowKey" as it is not reached with the thrown exception.

      Are there any plans or can we request an implementation of these methods in the UITree API in the next GA release ? In the meantime is there a work-around to achieve the above with implemented methods ...

      Thanking you in advance,
      -- Brian

        • 1. Re: UITree method not implemented --
          Nick Belaevski Master

          Hi Brian,

          You are probably using data model that doesn't support such operation. What is type of used tree nodes?

          • 2. Re: UITree method not implemented --
            Brian Antao Newbie

            Hi Nick,

            I have a separate datamodel for the tree nodes that implements the interface TreeNode and another interface from our system ... the method seems to accept instances of this tree nodes when compiled. ... but the error comes from the instance of the UITree that I am
            calling the method on .... the instances of the UITree I do not create but are generated from the rich:tree adviseNodeOpened parameter method binding.

            -- Brian

            • 3. Re: UITree method not implemented --
              Brian Antao Newbie

              Hi,
              here is part of the Stack Trace that I get --

              java.lang.UnsupportedOperationException
              at org.richfaces.model.AbstractTreeDataModel.getTreeNodeRowKey(AbstractTreeDataModel.java:148)
              at org.richfaces.component.UITree.getTreeNodeRowKey(UITree.java:1068)
              at com.arjuna.agility.portal.sa.SAMBean.treeNodeSelected(SAMBean.java:519)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
              at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
              at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
              at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
              at org.richfaces.renderkit.TreeRendererBase$DataVisitorWithLastElement$1.adviseNodeSelected(TreeRendererBase.java:309)
              at org.richfaces.renderkit.TreeRendererBase$DataVisitorWithLastElement.processAdvisors(TreeRendererBase.java:327)
              at org.richfaces.renderkit.TreeRendererBase$DataVisitorWithLastElement.process(TreeRendererBase.java:230)
              at org.richfaces.model.AbstractTreeDataModel.processElement(AbstractTreeDataModel.java:111)
              at org.richfaces.model.StackingTreeModel.doWalk(StackingTreeModel.java:296)
              at org.richfaces.model.StackingTreeModel$Visitor1.process(StackingTreeModel.java:409)
              at org.richfaces.model.StackingTreeModel$ShiftingDataVisitor.end(StackingTreeModel.java:454)
              at org.richfaces.model.StackingTreeModel.doWalk(StackingTreeModel.java:343)
              at org.richfaces.model.StackingTreeModel.walk(StackingTreeModel.java:381)
              at org.richfaces.component.UITree.walk(UITree.java:422)
              at org.richfaces.renderkit.TreeRendererBase.writeContent(TreeRendererBase.java:655)
              at org.richfaces.renderkit.TreeRendererBase.encodeChildren(TreeRendererBase.java:601)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
              at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
              at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
              at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:284)
              at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
              at org.richfaces.renderkit.html.SimpleToggleControlTemplate.doEncodeChildren(SimpleToggleControlTemplate.java:347)
              at org.richfaces.renderkit.html.SimpleToggleControlTemplate.doEncodeChildren(SimpleToggleControlTemplate.java:342)
              at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
              at org.richfaces.renderkit.html.SimpleTogglePanelRenderer.encodeChildren(SimpleTogglePanelRenderer.java:201)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
              at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:234)
              at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:239)
              at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:239)
              at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:178)
              at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:126)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
              at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
              at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
              at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)

              • 4. Re: UITree method not implemented --
                Nick Belaevski Master

                This type of data model does not work with TreeNode objects, that's why the exception is thrown.