Revision history [back]

click to hide/show revision 1
initial version

answered 2011-07-11 12:45:58 +0800

valmar gravatar image valmar

http://www.timo-ernst.net

Hmm... the "demo" in TreeError.zip works now after simply calling setData(...) on the node but in my "real" project I still get the same old exception after doing the change.

org.zkoss.zk.ui.UiException: Not a child: <Treeitem null>
    at org.zkoss.zul.Tree.addItemToSelection(Tree.java:845)
    at org.zkoss.zul.Tree$Renderer.render(Tree.java:1684)
    at org.zkoss.zul.Tree$Renderer.access$800(Tree.java:1664)
    at org.zkoss.zul.Tree.renderChangedItem(Tree.java:1851)
    at org.zkoss.zul.Tree.onTreeDataContentChange(Tree.java:1405)
    at org.zkoss.zul.Tree.onTreeDataChange(Tree.java:1337)
    at org.zkoss.zul.Tree.access$400(Tree.java:95)
    at org.zkoss.zul.Tree$4.onChange(Tree.java:1463)
    at org.zkoss.zul.AbstractTreeModel.fireEvent(AbstractTreeModel.java:77)
    at org.zkoss.zul.DefaultTreeNode.setData(DefaultTreeNode.java:119)

So, I guess the mistake is somewhere in my code but I just cannot find it..


Gsim, One thing I noticed about the code you posted:

public void addItemToSelection(Treeitem item) {
    if (item.getTree() != this)
        throw new UiException("Not a child: "+item);

The exception says: Not a child: <treeitem **null**="">

What exactly is the term "null" refering to at this point? The item itself cannot be null. So, what's null then?

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More