In the following code, the localProductId binding fails. Why?
The 1st alert pops with a new value for the variable (indicating that
it is changing). But the second alert never pops.
Attach Code
[Bindable] public var localProductsAC:ArrayCollection = new
ArrayCollection;
[Bindable] public var localVersionsAC:ArrayCollection = new
ArrayCollection;
[Bindable] public var localReleasesAC:ArrayCollection = new
ArrayCollection;
[Bindable] public var localProductId:uint;
[Bindable] public var localVersionId:uint;
public function myCreationComplete():void
{
//bind local products AC to VML source
BindingUtils.bindSetter(productResult, PrdVML.getInstance
(), "sourcePrdVOList");
//bind version refresh to product id change
BindingUtils.bindSetter(versionRefresh, this, "localProductId");
//bind local versions AC to VML source
BindingUtils.bindSetter(versionResult, VrsVML.getInstance
(), "sourceVrsVOList");
productRefresh();
}
public function productRefresh():void
{
//fetch the list of products
var outEvent:CairngormEvent = new CairngormEvent
(PrdController.FETCH_ALL);
CairngormEventDispatcher.getInstance().dispatchEvent(outEvent);
}
public function productResult(value:ArrayCollection):void
{
localProductsAC = value;
localProductId = value.getItemAt(0).PrdId;
Alert.show(String(localProductId));
}
public function versionRefresh(value:uint):void
{
//fetch versions
Alert.show('hit');
var fetchVersionsEvent:MyEvent = new MyEvent
(VrsController.FETCH_FOR_PRODUCT);
fetchVersionsEvent.eventObject = {PrdId:localProductId};
CairngormEventDispatcher.getInstance().dispatchEvent
(fetchVersionsEvent);
}