If I change the bTuesdayOfficeClosed variable from the original “false” to “true”, it immediately changes to “true” in the live expression viewer.
If I change any of the “true” values to “false”, the variable DOES NOT change to “false” in the live expression viewer and upon clicking “save” to the row edit, the variables return to the server as “true” even though it appeared to be “false” in the edited row.
I’ve tried a couple other values (such as “!true”, “FALSE”, and “0”) in an attempt to find anything that does evaluate to false but anything I’ve tried other than “false” itself results in a client-side “Cannot coerce …” error.
Are there any other way you can think of to get a “false” value to get parsed and passed back to the ViewModel properly?
state.A.B.C = false expressions do not work by design, as the state objects are copy-on-write to enable change cheap tracking. If you want mutable object API, you can use dotvvm.viewModels.root.viewModel.A().B().C(false). See Read & modify viewmodel from JS | DotVVM Documentation
I’m updating it via the form on the page and just observing the changes through the console.
If I change it from false to true on the single-line edit on the form, I see it change immediately in the console.
If I change a true value to false on the single-line edit on the form you never see it change in the console and when you fire the save a true is sent back to the view model server side.
Sorry, I missed that. This is a bug in the type conversion which is currently only fixed in the 4.3 preview version. We didn’t want to backport this to 4.2, as it may not be completely safe to update. Could you please try updating DotVVM to 4.3 (no need need to update BusinessPack)
Great, thanks for verifying that. I’m not aware of similar regressions. However, we rewrote approximately everything since 2.x, so it is very much possible that you’ll encounter something. Definitely let us know if you find some other issue.