Hi.
I have a custom component which uses data from my modellocator.
Depending on the way this component is called depends where abouts
this data comes from,
ie:
private var _itemLocation:Object;
[Bindable]
protected function get itemLocation():Object
{
if(isAssets)
_itemLocation = model.factfind.assets;
else
_itemLocation = model.factfind.liabilities;
return _itemLocation;
}
protected function set itemLocation(value:Object):void
{
_itemLocation = value;
}
model.factfind.assets and model.factfind.liabilities are both
ArrayCollections.
then, later on, I have
<mx:Label text="{itemLocation.selectedAssets.getItemAt(0).name}"/>
Now, this doesn't update as I'd expect when the first item in
itemLocation.selectedAssets changes (whatever itemLocation refers to)
If I change it to
<mx:Label
text="{model.factfind.assets.selectedAssets.getItemAt(0).name}"/>
it works perfectly.
So it seems that when I do the set/get on itemLocation, it copies the
value of model.factfind.assets/liabilities rather than acting as a
"pointer" to that.
How do I get it to work like a pointer so when model.factfind.assets
changes, so does itemLocation, in order that I can use the same
component for both assets and liabilities?
Thanks