/******************************************************************************************************************************** * Licensed Materials - Property of IBM * * * * IBM Cognos Products: AGS * * * * (C) Copyright IBM Corp. 2005, 2008 * * * * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. * *********************************************************************************************************************************/ //*************************************************** //start NonDuplicationItems object //*************************************************** function NonDuplicationItems(sItems) { //This list should not be displayed really. var uiStyle = new CUIStyle("CList_li", "CList_over", "CList_selected", "", null); this.cList = new CList('NonDupList',true, "CList_ul",uiStyle); this.DELIM=';'; this.parseFromString(sItems); this.cList.setEqualityFunc( function listEqualityCheck(list,node) { var result = false; var items = list.getAllItems(); for (var i=0; items && i < items.length;i++) { result = result || items[i].nodeValue.localeCompare(node.nodeValue) == 0; } return result; } ); } /** * remove a non dupe item from this if there is one */ NonDuplicationItems.prototype.getList = function() { return this.cList; } /** * remove a non dupe item from this if there is one */ NonDuplicationItems.prototype.removeItem = function(sItem) { var nodes = this.cList.getAllNodes(); for (var i=0; i < nodes.length; i++) { if(nodes[i].firstChild.nodeValue.localeCompare(sItem)== 0){ var index = this.cList.indexById(nodes[i].id); this.cList.remove(index); } } } /** * remove a non dupe item from this if there is one */ NonDuplicationItems.prototype.items = function() { var result = new Array(); var items = this.cList.getAllItems(); for (var i=0; i < items.length; i++) { result.push(items[i].nodeValue); } return result; } NonDuplicationItems.prototype.containsItem = function(sItem) { var textNode = document.createTextNode(sItem); return this.cList.containsItem(textNode); } //load all the query items into the textarea NonDuplicationItems.prototype.toString = function() { var theStr = ""; var textNodes = this.cList.getAllItems(); for (var i=0;i