You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Bind(Direction.None)]
public IEnumerable<string> MyData
{
get
{
return new string[] { "Thomas", "Billy" };
}
}
When running this code, you will see the data, since it is rendered on the server, but if you open up the Developer tools in the browser and look at the console tab, you will see this error:
Uncaught ReferenceError: Unable to process binding "dotvvm-SSR-foreach: function(){return {"data":MyData} }"
Message: MyData is not defined
at dotvvm-SSR-foreach (eval at createBindingsStringEvaluator (knockout:3293), <anonymous>:3:86)
at evaluateValueAccessor (knockout:3566)
at knockout:3743
at ko.computed.disposeWhenNodeIsRemoved (dotvvm--internal:2943)
at Function.evaluateImmediate_CallReadThenEndDependencyDetection (knockout:2403)
at Function.evaluateImmediate_CallReadWithDependencyDetection (knockout:2360)
at Function.evaluateImmediate (knockout:2325)
at Object.ko.computed.ko.dependentObservable (knockout:2157)
at init (dotvvm--internal:2942)
at knockout:3802
If you remove the bind direction on the property, then it works fine, but the data is also part of the view model JSON sent to the browser. Isn't it possible to render this on the server side without sending the data in the view model? Then it doesn't make sense to render it server side, because the data will be sent twice.
-Thomas
The text was updated successfully, but these errors were encountered:
Hi! Sorry for the late reply, this currently a fundamental limitation of DotVVM, you always have to send the repeater collections to client. You can however mark all properties inside the object as [Bind(Direction.None)] and then use resource binding on them in the markup.
I'm currently working on removing this limitation in #1392 - In that version you'd be able to use <dot:Repeater DataSource={resource: MyData}> ... </dot:Repeater> to render it server-side only.
Hi,
If you have a repeater rendered server side using a property with no bind direction, a Knockout Javascript error occurs. Take this simple example:
In the view model, you have this property:
When running this code, you will see the data, since it is rendered on the server, but if you open up the Developer tools in the browser and look at the console tab, you will see this error:
If you remove the bind direction on the property, then it works fine, but the data is also part of the view model JSON sent to the browser. Isn't it possible to render this on the server side without sending the data in the view model? Then it doesn't make sense to render it server side, because the data will be sent twice.
-Thomas
The text was updated successfully, but these errors were encountered: