Created Issue: JavaScriptView works slightly difference [6462]

2 views
Skip to first unread message

sparkviewengine Issue Tracker Rss Feed

unread,
Jul 7, 2010, 1:42:01 PM7/7/10
to spar...@googlegroups.com
I have a partial view. The view has a binding ${Product.Barcode} and the barcode is set to null. If the view is generated on the server side it works well. The result of the binding is empty string. But when I use generated JavaScript view code to build html tree it doesn't work, because the JavaScript code contains following line:

this.Write = function(arg) {this._parts.push(arg.toString());};

It seems the Writer is invoked with arg = ${Product.Barcode} (null) and null reference exception is thrown.
I would expect the both compiled views (C# and JavaScript) should accept the same parameters and produce the same results.

URL: http://sparkviewengine.codeplex.com/workitem/6462

TMFReason

unread,
Jul 8, 2010, 12:31:51 PM7/8/10
to Spark View Engine Dev

Although you should expect the same result, the best practice may be
to use $!{Product.Barcode} since it may be null. Hopefully that will
fixed the Javascript result, but I can't say for sure.

From http://www.sparkviewengine.com/documentation/expressions :
"The syntax $!{expression} can also be used if you want to ensure any
null values and NullReferenceException that result from the expression
will produce no output at all."
Reply all
Reply to author
Forward
0 new messages