[
http://issues.apache.org/jira/browse/MYFACES-760?page=comments#action_12356402
]
Andrew Efremov commented on MYFACES-760:
----------------------------------------
This is my recursive function for creating tree
public TreeNodeBase WayRoundTree(Classifier node){
TreeNodeBase tree = new TreeNodeBase("document", node.getName(),
node.getId().toString(), false);
System.err.println("Rubric: " + node.getId() + node.getName()); /*Here
tree.isLeaf() == true , strange enough*/
tree.setLeaf(false);
log.info("Node: " + tree.getDescription() + " лист " + tree.isLeaf());
/*Here tree.isLeaf() == true */
Iterator it = node.getChildClassifiers().iterator();
if (!it.hasNext()) tree.setLeaf(true);
while (it.hasNext()){
tree.getChildren().add(WayRoundTree((Classifier) it.next()));
tree.setLeaf(false);
/* explicitly set Leaf = false again*/
tree.setType("bar-folder");
}
log.info("Node: " + tree.getDescription() + " лист " + tree.isLeaf());
/*Here tree.isLeaf() == false where node is not a Leaf */
return tree;
}
When first time Tree became painted everything fine. But when I trying to do
some action which redisplays Tree I'm getting exception as I posted earlier.
Encountered a node [0:0] + with an illogical state. Node is expanded but it is
also considered a leaf (a leaf cannot be considered expanded.
Node may be diferent. Not only [0:0].
Please help me, tree is central component in my application. I can't moving
forward without it.
-- Andrew
> Tree2 setLeaf(false) error
> --------------------------
>
> Key: MYFACES-760
> URL: http://issues.apache.org/jira/browse/MYFACES-760
> Project: MyFaces
> Type: Bug
> Components: Tomahawk
> Versions: 1.1.0
> Environment: Tested in JBoss 4.0.3 with Seam
> Reporter: Andrew Efremov
> Assignee: sean schofield
> Priority: Blocker
>
> when trying to add nodes to tree2
> TreeNodeBase tree = new TreeNodeBase("document", node.getName(),
> node.getId().toString(), false);
> result node have tree.isLeaf() == true;
> the same is when you trying explicitly set Leaf
> tree.setLeaf(false);
> result node have tree.isLeaf() == true;
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira