1 Reply Latest reply on Aug 16, 2007 6:00 PM by peterent

    Flex Xml dataGrid

      Hi all,

      I am really new so please excuse my lack of knowledge. I have a flex app that keeps track of a workout program progress. Each user updates their stats each week.
      So I have a section where a new member can be added. I have a datagrid that is populated by an xml file along with a form to add a new member. When I test the app it works, the new user is added and shows up in the data grid. Of course when I run the app again the new user is no longer there. I would like to know how to get the app to update the xml file with the new information when a user is added. A way to save the input from the form into the xml file. If anyone can help me understand how to do this I would really be greatful.

        • 1. Re: Flex Xml dataGrid
          peterent Level 2
          Reading data is almost always easier that writing it. You probably used HTTPService to load the XML data. All you needed on the server was the XML file. The web server took care of reading the file and packaging it to send back to the Flash Player running the Flex application.

          The reverse isn't so straightforward. The Flex part is pretty simple however. I recommend using HTTPService with method="post" so you can send a larger amount of data than would be possible with method="get". If possible, to make it easy, send an entire XML document back - all of the data. Later you can figure out how to send just what gets updated. Baby steps are best.

          The Flex HTTPService has to send the data to something on the server which can write the XML file. Unlike reading the file and sending it, there isn't anything (at least that I'm aware of) ubiqutous to write the data. Your server system might already have something you can use - so check that first. If there is nothing, consider using PHP which is free and easy to learn. A PHP script can accept the XML data and write it to the server's disk.