How to detemine when an Model is populated
This technique resolves a timing problem. On an MXML page, if you need to present data that depend on something in a model, use the following technique to ensure that the model data are really there.
Put a listener function on the item you want to watch. In the model, code something like this (note the function call):
<mx:Model>
<mx:ModelVar> {myListererFunction()} </mx:ModelVar>
</mx:Model>
The binding watches the result of the service/cache/fileloading may be anything which is dynamic call, then fires the function when it changes.
An example:
<mx:Model>
<mx:ModelVar> {invokeModelListener (args)} </mx:ModelVar>
</mx:Model>
* invokeModelListener is a method, to which we are binding dynamic data.
* This method will invoke whenever data present in args because of Data Driven Approach in Flex.