I start with this.
Then I change each of the input boxes.
Notice that binding caused the text on the right to change in response to changes in only two of the inputs. That’s weird because the code is standard stuff.
Notice that the input tags are identical. The stache tags are identical. The only difference is that the second two items are part of an incoming array which I access with #each.
Note that…
-
if I address the values with ‘loginUser.first’ instead of #with, it doesn’t work at all.
-
if I change loginUser in some other way (eg, the console), both the input and stache item change in response.
My analysis is that the elements are wired up to the right thing. If I change the expected map, the changes pipe through to the UI. If I change the UI, changes are only reported back to the map for the dictionary item wrapped in an #each.
The creation of the map in question is a get().
because it is only retrieving one record. That record is, obviously, coming in as a nice list otherwise it wouldn’t show up in the editing form.
I note, finally, that when I get several users for the user management tool (this problem occurs on the profile editing tool), {{first}} is wrapped in a #each and works fine.
I am never a fan of attributing a bug to anything other than my own code. However, I have spent a couple of days trying to figure it out.
(I should note that, when I made the change handler parse the DOM and then actually wrote the data into the map, it worked fine. That is, when I took care of half of the two-way binding myself it worked. I don’t like that at all.)
I am now going to revise my code so that this thing is doing a getList() with a query that only retrieves this one item. Hopefully that will work.
If you can think of anything I can do to debug my code or yours, I would be grateful. In the meantime, I thought you should know.