ArrayCollection will fire a collectoinChange event when the data is populated, binding events will not fire.

 

Matt

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Thunder Stumpges
Sent: Thursday, July 27, 2006 8:36 AM
To: [email protected]
Subject: [flexcoders] DataService.fill() Binding to ArrayCollection not triggered.

 

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);

}
}

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to