rem: var ts = dojo.widget._templateCache[this.widgetType]; 
add: var ts = dojo.widget._templateCache[this.templatePath?this.templatePath.toString():this.widgetType]; 
context: 		buildFromTemplate: function(/*Object*/args, /*Object*/frag){			// summary:			//		Called by buildRendering, creates the actual UI in a DomWidget.			// var start = new Date();			// copy template properties if they're already set in the templates object			// dojo.debug("buildFromTemplate:", this);			var avoidCache = false;			if(args["templatepath"]){				avoidCache = true;				args["templatePath"] = args["templatepath"];			}			dojo.widget.fillFromTemplateCache(	this, 												args["templatePath"], 												null,												avoidCache);			var ts = dojo.widget._templateCache[this.widgetType];			if((ts)&&(!avoidCache)){				if(!this.templateString.length){					this.templateString = ts["string"];				}				if(!this.templateNode){					this.templateNode = ts["node"];				}			}			var matches = false;			var node = null;			// var tstr = new String(this.templateString); 			var tstr = this.templateString; 			// attempt to clone a template node, if there is one			if((!this.templateNode)&&(this.templateString)){				matches = this.templateString.match(/\$\{([^\}]+)\}/g);				if(matches) {					// if we do property replacement, don't create a templateNode					// to clone from.					var hash = this.strings || {};					// FIXME: should this hash of default replacements be cached in					// templateString?					for(var key in dojo.widget.defaultStrings) {						if(dojo.lang.isUndefined(hash[key])) {							hash[key] = dojo.widget.defaultStrings[key];						}					}					// FIXME: this is a lot of string munging. Can we make it faster?					for(var i = 0; i < matches.length; i++) {						var key = matches[i];						key = key.substring(2, key.length-1);						var kval = (key.substring(0, 5) == "this.") ? dojo.lang.getObjPathValue(key.substring(5), this) : hash[key];						var value;						if((kval)||(dojo.lang.isString(kval))){							value = new String((dojo.lang.isFunction(kval)) ? kval.call(this, key, this.templateString) : kval);							// Safer substitution, see heading "Attribute values" in  							// http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2							while (value.indexOf("\"") > -1) {								value=value.replace("\"","&quot;");							}							tstr = tstr.replace(matches[i], value);						}					}				}else{					// otherwise, we are required to instantiate a copy of the template					// string if one is provided.										// FIXME: need to be able to distinguish here what should be done					// or provide a generic interface across all DOM implementations					// FIMXE: this breaks if the template has whitespace as its first 					// characters					// node = this.createNodesFromText(this.templateString, true);					// this.templateNode = node[0].cloneNode(true); // we're optimistic here					this.templateNode = this.createNodesFromText(this.templateString, true)[0];					if(!avoidCache){						ts.node = this.templateNode;					}				}			}			if((!this.templateNode)&&(!matches)){ 				dojo.debug("DomWidget.buildFromTemplate: could not create template");				return false;			}else if(!matches){				node = this.templateNode.cloneNode(true);				if(!node){ return false; }			}else{				node = this.createNodesFromText(tstr, true)[0];			}			// recurse through the node, looking for, and attaching to, our			// attachment points which should be defined on the template node.			this.domNode = node;			// dojo.profile.start("attachTemplateNodes");			this.attachTemplateNodes();			// dojo.profile.end("attachTemplateNodes");					// relocate source contents to templated container node			// this.containerNode must be able to receive children, or exceptions will be thrown			if (this.isContainer && this.containerNode){				var src = this.getFragNodeRef(frag);				if (src){					dojo.dom.moveChildren(src, this.containerNode);				}			}		},
meta: 4707	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4707/50c3492c4c3c825dbd3401e134a19ed46799c456/DomWidget.js/clean/www/resources/dojo-ajax/src/widget/DomWidget.js