Changeset 15166
- Timestamp:
- 09/07/08 21:34:31 (3 months ago)
- Location:
- dijit/trunk
- Files:
-
- 2 modified
-
tests/_Templated.html (modified) (2 diffs)
-
_Templated.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/tests/_Templated.html
r13305 r15166 29 29 id: "test2", 30 30 num: 5, 31 bool: false, 31 32 text: "hello <\"' world", 32 33 33 templateString: "<button><span num=\"${num}\" >${text}</span></button>"34 templateString: "<button><span num=\"${num}\" value=\"${bool}\">${text}</span></button>" 34 35 }); 35 36 … … 84 85 var wrapper=dojo.byId("variables1Wrapper"); 85 86 wrapper.appendChild(widget.domNode); 86 t.is('<button widgetid=\"test2\"><span num="5" >hello <"\' world</span></button>', wrapper.innerHTML.toLowerCase());87 t.is('<button widgetid=\"test2\"><span num="5" value="false">hello <"\' world</span></button>', wrapper.innerHTML.toLowerCase()); 87 88 }, 88 89 89 function variables2(t){ 90 var widget = new VariableTemplate({id: "myid", num: -5, text: ""});90 function variables2(t){ 91 var widget = new VariableTemplate({id: "myid", num: -5, bool: true, text: ""}); 91 92 var wrapper=dojo.byId("variables2Wrapper"); 92 93 wrapper.appendChild(widget.domNode); 93 t.is('<button widgetid=\"myid\"><span num="-5" ></span></button>', wrapper.innerHTML.toLowerCase());94 t.is('<button widgetid=\"myid\"><span num="-5" value="true"></span></button>', wrapper.innerHTML.toLowerCase()); 94 95 }, 95 96 function table(t){ -
dijit/trunk/_Templated.js
r14828 r15166 44 44 if(key.charAt(0) == '!'){ value = _this[key.substr(1)]; } 45 45 if(typeof value == "undefined"){ throw new Error(className+" template:"+key); } // a debugging aide 46 if( !value){ return ""; }46 if(value == null){ return ""; } 47 47 48 48 // Substitution keys beginning with ! will skip the transform step, … … 85 85 86 86 if(this.widgetsInTemplate){ 87 var cw = this._supportingWidgets = dojo.parser.parse(node);87 var cw = (this._supportingWidgets = dojo.parser.parse(node)); 88 88 this._attachTemplateNodes(cw, function(n,p){ 89 89 return n[p];