Assuming you want them in the same xml that comes from the server you need to
post data back to the server. Whenever your data updates, fire the HTTPservice
again to post new data (the new XML). If the backend does not have support for
this it needs to be created. It is up to you if you replace the whole XML in the
backend or send the whole XML or just parts of it. Also if the save fails you
need to take care of the data inconsistencies ....
So, I have to use two HTTPService.
One to provide the initial data - This should be binded to an XMLListCollection or ArrayCollection, then it has to be given as a dataProvider to the components and also this will get updated on making data(adding/updating) changes by the user
Another, HTTPService which holds a copy of the updated XML which is to be updated back in the server end.
Well not necessarily. While binding directly to the service in view is fast is
also not very clean and reusable. Try to put your data inside model classes,
view binds to those classes instead of the service. Also use a custom class to
wrap your service and that gives you flexibility to change server properties or
make 2 different calls with the same service. You need to write code yourself
but in the end it will be easier to adjust changes. So when you load data you
actually populate the model instead of bringing data straight to the view. This
code usually gets executed inside a command class. So to be more specific:
- var HTTPService
-- in here you have the service calling the get data method on the service
-- in here you have the service calling the save data on the server
- controls binds to the model and display data from model
- when click on save or whatever gesture you use for saving you dispatch an
event with the new data.
You should use some MVC framework to do this for you..
When event is dispatched the framework will create a command class instance and
run it ...
- var service:CustomService
function fault() - for the success or fault of the service call ...
you can perform additional data transformation here id needed or employ the use
of other class to do that if necessary ...
Hope this makes sense. It is more work involved as you can see.
Or you can go with 2 HTTPService instance in the view ...