#17278 closed defect (fixed)
partial rebuild fails when inserting into StatefulArray
Reported by: | Stefan Meyer | Owned by: | Ed Chatelain |
---|---|---|---|
Priority: | undecided | Milestone: | 1.9.2 |
Component: | DojoX MVC | Version: | 1.9.1 |
Keywords: | Cc: | Akira Sudoh | |
Blocked By: | Blocking: |
Description
WidgetList? listens to StatefulArray? changes via watchElements. Before that event is fired the new elements are inserted into the StatefulArray? as undefined values. Then the values are set in a stateful manner via set(index, value). This leads to a property value change event being fired. The WidgetList? will update the target prop in the child widget. This is where things go wrong. The WidgetList?'s new children are not inserted yet. Therefore the target of the current child widget at the index is updated.
Given a list of names like ["john", "will"]. Inserting a new name "Henry" at index 1 results first in an update of the second widget being bound to "Henry" instead of "will" and then a new widget is inserted at index 1. Effectivly the WidegtList? is now bound to ["john", "henry", "henry"] and the Stateful instances at index 1 and 2 are identical.
The problem can be resolved by not updating the elements in a stateful manner.
I created a pull request for this in edhcat/dojox_mvc Unfortunately I did not find a proper testcase for this in 1,9 so I reactivated one from 1.9.
Change History (6)
comment:1 Changed 7 years ago by
Cc: | Akira Sudoh added |
---|---|
Owner: | set to Ed Chatelain |
Status: | new → assigned |
comment:2 Changed 7 years ago by
comment:3 Changed 7 years ago by
Pull req to dojo/dojox available in: https://github.com/dojo/dojox/pull/39
comment:4 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:6 Changed 7 years ago by
Milestone: | tbd → 1.9.2 |
---|
The original pull req to edchat/dojox_mvc is: https://github.com/edchat/dojox_mvc/pull/80