0 Replies Latest reply on Apr 18, 2008 3:42 PM by The Toad

    Problems in using the Iterator with the richTree

    The Toad Newbie

      Hi everybody.

      I have been experiencing some problems in retrieving the Interator that represents the richTree component and I would like to know if anyone could help me.
      I need to go over the whole tree in order to persist its data in a database. However, when I use the method getChildren(), which should return a Iterator, I get the following warning:

      WARNING: java.lang.ClassCastException: java.util.LinkedHashMap$Entry cannot be cast to org.richfaces.model.TreeNodeImpl
      


      After that I cannot access the children nodes.
      Have someone ever experienced the same problem? Thanks for any help.

      P.S: the souce code I've been using (it is very simple):
       Iterator it = selectedNode.getChildren();
       while(it.hasNext()){
       System.out.println(((TreeNodeImpl) it.next()).getData());
      }