I'm not at a dev machine, but just looked at the Kitchen Sink demo from the Pivot site. http://pivot.apache.org/demos/kitchen-sink.html The first TreeView in the 'Trees' Rollup appears to be editable with no exceptions being thrown when pressing 'Enter' to accept the edit. I tested editing a TreeNode, a TreeBranch with child nodes, and a TreeBranch without child nodes. (WinXP SP3, Opera 11.10, JRE version 1.6.0_24-b07 Java HotSpot(TM) Client VM)
Could you please try to replicate your issue with the Kitchen Sink demo? Chris On 14 April 2011 02:54, lello <[email protected]> wrote: > After a quick look at the TreeBranch class, > I think that this exception shouldn't thrown by the update() method, but > only by the insert. > I commented this part of the code in the update() method and everything > works as it should. > It this a bug or am I doing something wrong? > > > Greg Brown-2 wrote: > > > > I haven't looked into this yet, but that exception is thrown when you try > > to add a tree node to more than one parent. In other words, you can't add > > a tree node to a new tree without first removing it from the old tree. > > > > > > On Apr 13, 2011, at 2:29 PM, lello wrote: > > > >> Thanks, hopefully now someone else can give a look at the code. > >> The problem comes from the code: > >> > >> if (treeNode.getParent() != null) { > >> throw new IllegalArgumentException("treeNode already has a > >> parent."); > >> } > >> > >> in TreeBranch.java. I can't understand why treeNode must have null > parent > >> to > >> be updated. > >> > >> > >> > >> Duto wrote: > >>> > >>>> View this message in context: > >>>> > http://apache-pivot-users.399431.n3.nabble.com/TreeNodeEditor-issue-tp2815778p2816403.html > >>>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com. > >>> > >>> If I can help :) > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >> > >> > >> -- > >> View this message in context: > >> > http://apache-pivot-users.399431.n3.nabble.com/TreeNodeEditor-issue-tp2815778p2817244.html > >> Sent from the Apache Pivot - Users mailing list archive at Nabble.com. > > > > Greg Brown-2 wrote: > > > > I haven't looked into this yet, but that exception is thrown when you try > > to add a tree node to more than one parent. In other words, you can't add > > a tree node to a new tree without first removing it from the old tree. > > > > > > On Apr 13, 2011, at 2:29 PM, lello wrote: > > > >> Thanks, hopefully now someone else can give a look at the code. > >> The problem comes from the code: > >> > >> if (treeNode.getParent() != null) { > >> throw new IllegalArgumentException("treeNode already has a > >> parent."); > >> } > >> > >> in TreeBranch.java. I can't understand why treeNode must have null > parent > >> to > >> be updated. > >> > >> > >> > >> Duto wrote: > >>> > >>>> View this message in context: > >>>> > http://apache-pivot-users.399431.n3.nabble.com/TreeNodeEditor-issue-tp2815778p2816403.html > >>>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com. > >>> > >>> If I can help :) > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >> > >> > >> -- > >> View this message in context: > >> > http://apache-pivot-users.399431.n3.nabble.com/TreeNodeEditor-issue-tp2815778p2817244.html > >> Sent from the Apache Pivot - Users mailing list archive at Nabble.com. > > > > > -- > View this message in context: > http://apache-pivot-users.399431.n3.nabble.com/TreeNodeEditor-issue-tp2815778p2817541.html > Sent from the Apache Pivot - Users mailing list archive at Nabble.com. >
