XFormsTreeViewItem.prototype = new XFormsCaption; function XFormsTreeViewItem (strParentId, strId) { if (!strId) { return; } XFormsCaption.call(this, strParentId, ""/*strAlert*/, ""/*strHelp*/, ""/*strHint*/, ""/*strText*/, ""/*strAccesskey*/, false/*bAutoresize*/, ""/*strBind*/, ""/*strClass*/, false/*bDisabled*/, false/*bEllipsis*/, ""/*strFormat*/, strId, -1/*nNavindex*/, ""/*strRef*/, ""/*strRoundmode*/, -1/*nRoundposition*/, ""/*strStyle*/, "xforms:treeitem", "visible"/*strVisibility*/); this.checked; this.checkboxdisabled; this.depth; this.disabled; this.expanded; this.expandedImage; this.image; this.index; this.parentIndex; this.selectedImage; this.label = ""; this.value = ""; this.itemset; }; XFormsTreeViewItem.prototype.init = function () { XFormsCaption.prototype.init.call(this); }; XFormsTreeViewItem.prototype.hasContained = function (heMember, nX) { if (null != heMember) { var nOffsetWidth = heMember.offsetWidth; var nOffsetX = heMember.offsetLeft; if ((nX >= nOffsetX && nX <= nOffsetX + nOffsetWidth)) { return true; } } return false; }; XFormsTreeViewItem.prototype.setSelect = function (bSelect) { var objCell = this.getRefElement(); if (null == objCell) { return; } var strId = objCell.id; var xnParent = this.parent; var xlRefNode = xnParent.getRefNode(); if (null != xlRefNode) { var xnRefNode = xlRefNode.item(0); if (null != xnRefNode) { var strNewValue = objCell.getValue(); if (bSelect) { xnParent.value = strNewValue; XmlLib.setTextValue(xnRefNode, strNewValue); } } } var heSelectRow; var strFullRowSelect = xnParent.getAttribute("fullrowselect"); var heSelectRow = objCell.getHtmlElement(); if ("true" == strFullRowSelect) { heSelectRow = document.getElementById("HE_" + strId); } else { heSelectRow = document.getElementById("HE_" + strId + "_content"); } if (bSelect) { HtmlLib.setStyle(heSelectRow, "color", "#FFFFFF"); HtmlLib.setStyle(heSelectRow, "background-color", "#316AC5"); } else { var strFontColor = xnParent.getAttribute("color"); if ("" == strFontColor) { strFontColor = "#000000"; } HtmlLib.setStyle(heSelectRow, "color", strFontColor); HtmlLib.setStyle(heSelectRow, "background-color", ""); } }; /** * getter, setter */ XFormsTreeViewItem.prototype.getDepth = function () { return this.depth; }; XFormsTreeViewItem.prototype.setDepth = function (strDepth) { this.depth = strDepth; }; XFormsTreeViewItem.prototype.getExpanded = function () { return this.expaned; }; XFormsTreeViewItem.prototype.setExpanded = function (strExpanded) { this.expanded = strExpaned; }; XFormsTreeViewItem.prototype.getExpandedImage = function () { return this.expandedImage; }; XFormsTreeViewItem.prototype.setExpandedImage = function (strExpandedImage) { this.expandedImage = strExpandedImage; }; XFormsTreeViewItem.prototype.getIndex = function () { return this.index; }; XFormsTreeViewItem.prototype.setIndex = function (strIndex) { this.index = strIndex; }; XFormsTreeViewItem.prototype.getParentIndex = function () { return this.parentIndex; }; XFormsTreeViewItem.prototype.setParentIndex = function (strParentIndex) { this.parentIndex = strParentIndex; }; XFormsTreeViewItem.prototype.getSelectedImage = function () { return this.selectedImage; }; XFormsTreeViewItem.prototype.setSelectedImage = function (strSelectedImage) { this.selectedImage = strSelectedImage; }; XFormsTreeViewItem.prototype.setItemSet = function (objItemSet) { this.itemset = objItemSet; }; XFormsTreeViewItem.prototype.getItemSet = function () { return this.itemset; }; XFormsTreeViewItem.prototype.setLabel = function (objLabel) { this.label = objLabel; }; XFormsTreeViewItem.prototype.getLabel = function () { return this.label; }; XFormsTreeViewItem.prototype.setValue = function (objValue) { this.value = objValue; }; XFormsTreeViewItem.prototype.getValue = function () { return this.value; }; XFormsTreeViewItem.prototype.setAttribute = function (strAttribute, strValue) { XFormsCaption.prototype.setAttribute.call(this, strAttribute, strValue); switch (strAttribute) { case "nodeset" : { if (null != this.parent) { this.parent.nodeset = strValue; } break; } } }; XFormsTreeViewItem.create = function (strParentId, clAttribute) { var strId = clAttribute.item("id") ? clAttribute.item("id") : ""; var objControl = new XFormsTreeViewItem(strParentId, strId); var arKeys = clAttribute.keys(); for (var i=0; i