@SuppressWarnings("unchecked") protected void smartUpdate(String name, Object value) { Component comp = getParent(); if (comp instanceof Treeitem) { Treerow tr = ((Treeitem) comp).getTreerow(); if (tr != null) tr.smartUpdate(name, value); } else if (comp instanceof Tree) { ((Tree) comp).smartUpdate(name, value); } else { // do it later for bug ZK-2206 Map<String, Object> attributes = (Map<String, Object>) getAttribute( "org.zkoss.zul.Treechildren_smartUpdate"); if (attributes == null) { attributes = new LinkedHashMap<String, Object>(3); setAttribute("org.zkoss.zul.Treechildren_smartUpdate", attributes); } attributes.put(name, value); } }