The problem occurred when we had two DateField interface components pointing to the same data model field. The two DateFields would be hooked up to a single data model field, and we saw the following behavior:
- If we bound the DateField.selectedDate to the model.birthday (as an example), with one DateField Instance, all would work. Underneath, it set off the bindings twice when you changed the selectedDate, but that was OK. With multiple DateField Instances, it would crash as it tried to create the second DateField. (This happened when we preinitialized the DateField and without preinitializing the DateField) Underneath, it would set off the bindings between the three items infinitely.
- If we bound the DateField.data to the model.birthday, it would never infinitely loop, but model.birthday wouldn't get updated when DateField was changed. I think that the code for DateField.data is screwy, but according to the documentation, it seems like this is the property you should bind to.
- If I tried binding the DateField.data to the model.birthday and the model.birthday to the DateField.selectedDate, it would also loop infinitely.
My theory is that Date comparisons are broken or behave oddly, and if you just compare Date.time, it works as expected. I'm assuming this is why the binding went forever, but I can't be sure.
Hope this helps someone else.. some also possibly helpful links:
http://devel.teratechnologies.net/steve_examples/Flex_BindingProblem/DateTest.html
http://bugs.adobe.com/jira/browse/SDK-15618
1 comment:
I believe this is due to the weird implementation of equality in Flex.
See the following link for additional details:
http://blog.iconara.net/2007/11/25/architectural-atrocities-part-8-is-there-no-equality/
Post a Comment