//if no children the element is a <li><a...
// if(childs==null || childs.length==0) {
String nodeAttrs = href!=null ? ("tag:'a',href:'"+href+"',cdata:'"+label+"'") :
("tag:'span',cdata:'"+label+"'");
Node labelEl = NODE(Y, nodeAttrs, null, null),
el = NODE(Y, "tag:'li',class:'yui3-menuitem'", null, new Node[]{labelEl});
if(clickHandler!=null)
labelEl.on("click", clickHandler);
if(childs!=null&&childs.length>0) {
// labelEl.addClass("yui3-menuitem-content");
labelEl.addClass("yui3-menu-label");
Node root = NODE(Y, "tag:'div',class:'yui3-menu'", null, null),
content = NODE(Y, "tag:'div',class:'yui3-menu-content'", null, null),
list = NODE(Y, "tag:'ul'", null, null);
root.append(content);
content.append(list);
for (int i = 0; i < childs.length; i++) {
list.append(childs[i]);
}
el.append(root);