Created
March 21, 2013 18:57
-
-
Save lordbron/5215670 to your computer and use it in GitHub Desktop.
Weird case where a setter on a binding is not being fired when binding to an object, but does fire when bound to one of its properties.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fires the setter: | |
"sampleComponent": { | |
"prototype": "ui/sample-component.reel", | |
"properties": { | |
"element": {"#": "sampleComponent"} | |
}, | |
"bindings": { | |
"contentController": {"<-": "@randomItems.content"} | |
} | |
}, | |
Does not fire the setter: | |
"sampleComponent": { | |
"prototype": "ui/sample-component.reel", | |
"properties": { | |
"element": {"#": "sampleComponent"} | |
}, | |
"bindings": { | |
"contentController": {"<-": "@randomItems"} | |
} | |
}, | |
Here's the serialization code for randome items: | |
"randomItems": { | |
"prototype": "montage/ui/controller/array-controller", | |
"properties": { | |
"selectObjectsOnAddition": true, | |
"automaticallyOrganizeObjects": true, | |
"content": [ | |
{ | |
"id": "ID003", | |
"order": "1", | |
"title": "Sample 1" | |
}, | |
{ | |
"id": "ID002", | |
"order": "2", | |
"title": "random text" | |
} | |
] | |
} | |
}, | |
getter/setter for the contentController | |
contentController: { | |
get : function () { | |
return this._contentController; | |
}, | |
set : function(value) { | |
if (this._contentController != value) { | |
this._contentController = value; | |
} | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment