Opened 8 years ago
Closed 8 years ago
#16682 closed enhancement (fixed)
arrays cannot be synced, because equals fails
Reported by: | Stefan Meyer | Owned by: | Ed Chatelain |
---|---|---|---|
Priority: | undecided | Milestone: | 1.9 |
Component: | DojoX MVC | Version: | 1.8.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I triede to bind an array to the dojox.form.CheckedMultiSelect?. It turns out that any update will provoke an infinite loop because array equality checks fail and therefore both ends fire value changed events.
The problem is sync.equals which does not work for arrays and objects. Maybe dojox.mv.equals should be used here.
Change History (7)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Is the option to define the equals operation also available for dojo.mvc.at? Like this:
at(stateful,property).equals(myEqualsImplementation)
comment:4 Changed 8 years ago by
Could you be more specific about how that can be done. I did not find it in the documentation.
comment:5 Changed 8 years ago by
Sorry if it confused you, but I meant: https://github.com/asudoh/dojox_mvc/commit/9f867e057a572cab94f49bd75cb66f877aaa8c84
comment:7 Changed 8 years ago by
Milestone: | tbd → 1.9 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Support for collection (array) requires special code in widget implementation, therefore limited number of widgets support it. (An example supporting array is
dojox/mvc/WidgetList
)dojox/form/CheckedMultiSelect
seems to mangle thevalue
attribute's value, which does not work well with the code checking value going back and forth. Not sure it's the issue this ticket reports, but if it's the case - There is an extension point indojox/mvc/sync
library so that such check can be changed, by doing something like below:It avoids infinite loop by setting
value
attribute with data binding, though it does not make the widget respond to change in array likepush()
call.