Hey guys,
I've set up binding (ChangeWatcher) to an ArrayCollection that is
passed to a DataService.fill() call. The DataService call completes,
and the result event has the results object.
With no action in my result handler, the ArrayCollection gets the
updated results, but he binding is never triggered on the
ArrayCollection.
If I manually re-assign the source array in the result handler the
binding IS called... is this as designed? See source below.
thanks,
Thunder
In the Application (watching)
public function initializeComponent(event:Event):void
{
// get notified when the dashboards are loaded.
dashboardDataWatcher =
mx.binding.utils.ChangeWatcher.watch(af.data.ConfigModelLocator.getInstance(),["dashboards","source"],onDashboardData);
// load the dashboards
CairngormEventDispatcher.getInstance().dispatchEvent(new
CairngormEvent(ApplicationFrontController.COMMAND_GET_DASHBOARDS));
}
private var dashboardDataWatcher:ChangeWatcher;
public function onDashboardData(event:Event):void
{
// we got data
var oDashboard:Object = af.data.ConfigModelLocator.getInstance().dashboards;
}
In the Delegate:
public function getDashboards() : void
{
call = service.fill(
ConfigModelLocator.getInstance().dashboards,
"DashboardsByApplicationid",
[ConfigModelLocator.getInstance().applicationid]);
service.addEventListener(ResultEvent.RESULT,responder.onResult);
service.addEventListener(FaultEvent.FAULT,responder.onFault);
}
public function onResult(event:*=null):void
{
var result:Object = event.result;
if (result is Array)
{
// If I do this, then the binding is triggered, otherwise it is not.
// Either way the dashboards collection gets the result of the call.
// ConfigModelLocator.getInstance().dashboards.source = (result
as Array);
}
}