Hi. Are those variabes bound?
var listUsers:ArrayCollection = model.listUsers;
var totalRows:int = model.countUsers;

I'm new to Cairngorm, so I'm not sure,off the top of my head, how to assign 
binding from a script. Within a component, it's done with squigly brackets {}.

Also, is your whole ModelLocator class marked as Bindable?



--- In [email protected], "txakin" <txa...@...> wrote:
>
> Hi guys,
> 
> I'm developing an application with Flex and using Cairngorm framework with 
> the events, commands, controller, delegates and the services for the remote 
> object, because my application will connect with a server side.
> 
> My component is like that:
> 
> <mx:VDividedBox xmlns:mx="http://www.adobe.com/2006/mxml";
>       creationComplete="initView()" width="100%">
> 
> The initView method will execute a CairngormEvent to access to the database 
> and get all the users from my system and how many users i have:
> 
> [Bindable]
> public var model:ModelLocator = ModelLocator.getInstance();
> 
> private function initView():void{
>    //Find all the Users in the database
>    var findAllUsersEvent:FindAllUsersEvent = 
>        new FindAllUsersEvent();
>    
>    findAllUsersEvent.dispatch(); 
>    var listUsers:ArrayCollection = model.listUsers;
>    var totalRows:int = model.countUsers;
> }
> 
> Of course in my ModelLocator i have created the next properties:
> 
> public var listUsers:ArrayCollection
> public var countUsers:int;
> 
> In my command i call the method from the delegate to execute the correct 
> method of the remote object (it means of my java application running in the 
> server).
> 
> In the result method of the command, i assign the value of each properties.
> 
> If i debug the application, i get the correct results, but when i check the 
> value of 
> 
>    var listUsers:ArrayCollection = model.listUsers;
>    var totalRows:int = model.countUsers;
> 
> are not refreshed.
> I can imagine my problem is because Flex is asyncronous and when i assign the 
> values in the initView, maybe the Event is not yet finished.
> 
> How can i handle this kind of problem?
> I hope all of you have understood me...
> 
> Thanks in advance!!!!!!
>


Reply via email to