I have a RemoteObject(service) to communicate to the back end and retrieve the data. I used HttpService to create a form dynamically and I have datagrid on the form. Once, I clicked the get button in the form, the data should be retrieved from the database and shown in the datagrid.
As expected, I clicked the get button, it will dispatch the CairngormEvent(which will internally call the remoteObject and get the data) and which will get populated into the datagrid, but these both operations are happenning simulatneously.So, that I could not get the values in datagrid. If I click again, it is populating the values. I would like to prevent running simulatneous operation of these two, Only after the remoteObject is done with get all the values from backend, it should continue further.
Could you please help me to resolve this issue?
The key in this case is to change things to the remote service gets called in the HTTPService result handler after that result handler is done with whatever it needs to do, or perhaps a method is called inside the HTTPService result handler calling the remote service.
Another option, and perhaps the more logical one, is to call the remote service in the form creationComplete event handler, if the problem is that the form is not being created by the HTTPService yet.
Events like this in Flex are asynchronous, so it is necessary to structure things this way.
If this post answers your question or helps, please mark it as such.
Thanks a lot!
Let me try this second one and see what happens...