Skip to main content
Participant
January 6, 2009
Question

Newbie question: Completion Events for RemoteObject calls

  • January 6, 2009
  • 1 reply
  • 1080 views
I'm working on an application where I build a tree (in actionscript buildtree()) where I add new leafs from data that is retieve from a remote call.

Since the buildtree() function deals with the view - I have this coded in the view mxml. The tree is bound to a XMLListCollection which is updated by the buildtree() function.

The RetrieveDataCommand successfully retrieves the data into a business value object.

What is the correct Cairgorm method for triggering the builtree() function after the RetrieveDataCommand is complete?

I don't want to pollute my Command logic with any specific calls to buildtree()

Should I be adding RemoteCommandComplete events to all of my RemoteCommands? and then set the view logic to listen for them?

I tried to set a Collection.COLLECTION_CHANGE listener on the Business Value object from my View logic. But it seems to fire before the ArrayCollection is complete.

Any experts out there? I'm sure there must be a simple solution for this.
This topic has been closed for replies.

1 reply

Participant
January 8, 2009
I was just doing research on this topic. There are many solutions out there, but i think the "cleanest" way is basically to trigger a call to your buildtree() function base on a ModelLocator data change in value by using an Observer Class.

check out the following...

http://weblogs.macromedia.com/auhlmann/archives/2007/02/creating_a_popu.html

http://weblogs.macromedia.com/auhlmann/archives/2006/09/using_binding_s.html