out.startElement(HTML.UL_ELEM, tree); expanded = true;
System.out.println("**************************************"); System.out.println("!showRootNode children = "+ node.getChildCount()); System.out.println("**************************************");  if(!node.isLeaf()){ out.startElement(HTML.UL_ELEM, tree); expanded = true; }
    protected void encodeRoot(FacesContext context, ResponseWriter out, IWTree tree, TreeWalker walker) throws IOException {    	boolean clientSideToggle = tree.isClientSideToggle();    	boolean expanded = false;      	HtmlRendererUtils.writePrettyLineSeparator(context);     	out.startElement(HTML.LI_ELEM, tree);      	out.writeAttribute(HTML.ID_ATTR, tree.getDataModel().getNodeById(tree.getNodeId()).getIdentifier(), null);    	out.writeAttribute("noDrag","true",null);      	encodeRootNode(context, out, tree);    	if (clientSideToggle){//    		String spanId = TOGGLE_SPAN + ":" + tree.getId() + ":" + tree.getNodeId();    		String spanId = "spanId2" + tree.getDataModel().getNodeById(tree.getNodeId()).getIdentifier();    		out.startElement(HTML.SPAN_ELEM, tree);//    		out.writeAttribute(HTML.ID_ATTR, spanId, null);    		out.writeAttribute(HTML.ID_ATTR, tree.getDataModel().getNodeById(tree.getNodeId()).getIdentifier(), null);//    		if (tree.isNodeExpanded()) {    		if (!tree.getDataModel().getNodeById(tree.getNodeId()).isLeaf()) {    		out.writeAttribute(HTML.STYLE_ATTR, "display:block", null);    		}    		else {    			out.writeAttribute(HTML.STYLE_ATTR, "display:none", null);    		}    	}    	TreeNode node = tree.getNode();     	out.startElement(HTML.UL_ELEM, tree);    	expanded = true;    	int child_count = node.getChildCount();    	for (int i=0; i < child_count; i++){    		if (walker.next()) {    	    			encodeTree(context, out, tree, walker, node);    		}    	}    	if (clientSideToggle) {    		out.endElement(HTML.SPAN_ELEM);    	}    	if (expanded) {         		out.endElement(HTML.UL_ELEM);      	}    	out.endElement(HTML.LI_ELEM);}