I am trying to configure a rather complex model to bind a view to using KnockoutJS.
Here is a problem markup section:
<input type="text" data-bind="visible: dialogSelectedCode.HasValue, value: dialogSelectedCodeValue"/>
<span data-bind="text: ko.toJSON(dialogSelectedCode)"></span>
input element is never shown, but my "debug" span shows the contents
{"Code":"{intInc_G}","HasValue":true}
What is the correct way to bind a visible of my input in case the "decision"-data is hidden inside JSON object?
UPDATE: Here is a rather complex fiddle of the problem. To get to the problem dialog, run the fiddle, click "Add block" and try choosing several items in the drop down input (especially first and the second one - since they clearly show that dialogSelectedCode variable is indeed being updated.
visisbleproperty to update when it changes. Putting it in JSON will not work.HasValueis not observable.