0 Replies Latest reply on Mar 27, 2008 7:12 PM by Tomas Cerny

    HtmlRecursiveTreeNodesAdaptor cast exception

    Tomas Cerny Novice

      Hello,

      I have a question about RecursiveTreeNodesAdaptor I want to have a link that opens the whole tree. I tried to bind the tree to my bean

      <rich:tree switchType="client" id="tree">
       <rich:recursiveTreeNodesAdaptor id="contests" var="contest"
       binding="#{treeOpener.adaptor}"
       roots="#{contestSystemActionManager.currentTreeWithSites}"
       nodes="#{contest.childrenList}">
      
       <rich:treeNode
       id="node"
       icon="/img/tree/#{contest.type}.png"
       iconLeaf="/img/tree/#{contest.type}.png">
       <h:outputText value="#{contest.name}" />
      
       </rich:treeNode>
       </rich:recursiveTreeNodesAdaptor>
       </rich:tree>
      


      bean

      @Stateless
      @Name("treeOpener")
      public class treeOpener implements ITreeOpener {
      
       UIComponent adaptor;
      
      
      
       public UIComponent getAdaptor() {
       return adaptor;
       }
      
       public void setAdaptor(UIComponent adaptor) {
       this.adaptor = adaptor;
       }
      
       public void adaptorExpand() {
       //Object x = adaptor.getNodes();
       return;
       }
      }
      


      I cannot then recast UIComponent adaptor to HtmlRecursiveTreeNodesAdaptor;
      (org.richfaces.component.html.HtmlRecursiveTreeNodesAdaptor) adaptor
      throws
      ClassCastException: Cannot cast org.richfaces.component.html.HtmlRecursiveTreeNodesAdaptor (id=188) to org.richfaces.component.html.HtmlRecursiveTreeNodesAdaptor
      


      Someone knows?

      To deploy the application correct where are supposed to be
      richFaces-impl and richFaces-ui jars?

      in {war.dir}/WEB-INF/lib?
      or in ${ear.dir}
      or in both?

      Thanks