You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by skatz <st...@nokia.com> on 2009/03/16 22:03:32 UTC
Re: Illegal State Exception on DefaultTeeModel.removeNodeFromParent
I have the same problem using 1.3.5, but not when using 1.3.3. I spent some
time tracing the source code and it seems related to the addition of this
line:
getTreeState().selectNode((TreeNode)item.getModelObject(), false);
at the very end of the function (line 835):
AbstractTree.treeNodesRemoved()
This line results (eventually) in a call to
AbstractTree.invalidateNode()
which on line 1295 calls:
item.remove()
which alters the state of "item" such that the call to item.remove() in
AbstractTree.treeNodesRemoved() fails with the exception mentioned
previously.
I note that the IItemCallback() code, immediately above, calls two identical
lines in the reverse order. I wonder reversing the later two would fix the
problem?
--
View this message in context: http://www.nabble.com/Illegal-State-Exception-on-DefaultTeeModel.removeNodeFromParent-tp20185042p22547387.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Illegal State Exception on DefaultTeeModel.removeNodeFromParent
Posted by skatz <st...@nokia.com>.
I posted a bug (WICKET-2178) with a test case/source code. The last action I
saw on it was it was assigned to Matej Knopp back in April.
I tested the same code against the 1.4 code and it seemed to work.
Leena wrote:
>
> Any resolution on this? Or may be some workaround? I am facing a similar
> issue, so thought this could be related.
>
> I am getting a NullPointerException while trying to move nodes within the
> tree (ajax requests)
>
> Partial Stack trace:
> java.lang.NullPointerException
> at
> org.apache.wicket.markup.html.tree.AbstractTree.treeNodesInserted(AbstractTree.java:790)
> at javax.swing.tree.DefaultTreeModel.fireTreeNodesInserted(Unknown
> Source)
> at javax.swing.tree.DefaultTreeModel.nodesWereInserted(Unknown
> Source)
> at javax.swing.tree.DefaultTreeModel.insertNodeInto(Unknown Source)
>
> Please let me know if there is any solution/workaround to this. I am using
> wicket-1.3.5.
>
> +Leena
>
>
> skatz wrote:
>>
>> I have the same problem using 1.3.5, but not when using 1.3.3. I spent
>> some time tracing the source code and it seems related to the addition of
>> this line:
>>
>> getTreeState().selectNode((TreeNode)item.getModelObject(), false);
>>
>> at the very end of the function (line 835):
>>
>> AbstractTree.treeNodesRemoved()
>>
>> This line results (eventually) in a call to
>>
>> AbstractTree.invalidateNode()
>>
>> which on line 1295 calls:
>>
>> item.remove()
>>
>> which alters the state of "item" such that the call to item.remove() in
>> AbstractTree.treeNodesRemoved() fails with the exception mentioned
>> previously.
>>
>> I note that the IItemCallback() code, immediately above, calls two
>> identical lines in the reverse order. I wonder reversing the later two
>> would fix the problem?
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Illegal-State-Exception-on-DefaultTeeModel.removeNodeFromParent-tp20185042p23640768.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Illegal State Exception on DefaultTeeModel.removeNodeFromParent
Posted by Leena <le...@yahoo.com>.
Collapsing the node works :)
+Leena
--
View this message in context: http://www.nabble.com/Illegal-State-Exception-on-DefaultTeeModel.removeNodeFromParent-tp20185042p23556124.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Illegal State Exception on DefaultTeeModel.removeNodeFromParent
Posted by Leena <le...@yahoo.com>.
Any resolution on this? Or may be some workaround?
+Leena
skatz wrote:
>
> I have the same problem using 1.3.5, but not when using 1.3.3. I spent
> some time tracing the source code and it seems related to the addition of
> this line:
>
> getTreeState().selectNode((TreeNode)item.getModelObject(), false);
>
> at the very end of the function (line 835):
>
> AbstractTree.treeNodesRemoved()
>
> This line results (eventually) in a call to
>
> AbstractTree.invalidateNode()
>
> which on line 1295 calls:
>
> item.remove()
>
> which alters the state of "item" such that the call to item.remove() in
> AbstractTree.treeNodesRemoved() fails with the exception mentioned
> previously.
>
> I note that the IItemCallback() code, immediately above, calls two
> identical lines in the reverse order. I wonder reversing the later two
> would fix the problem?
>
>
--
View this message in context: http://www.nabble.com/Illegal-State-Exception-on-DefaultTeeModel.removeNodeFromParent-tp20185042p23541664.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org