views:

450

answers:

1

Is it possible to create a dynamic xml file which changes in some fields to populate an advanced data grid? I have to display continents, countries, society and its values but i want to change randomly only the value and not all toegether... The client side application call the database by an asynchronous httpservice. LCDS, Blaze or similar are not allowed. Thanks in advance

A: 

Yes, the application I'm working on right now does just this, but I have to get my data and parse through it to transform it into the proper XML.

My data comes in like this:

<rows>
  <row>
    <data_node attr1="something" attr1="something_else"/>
  </row>
  <row>
    <data_node attr1="something2" attr1="something_else2"/>
  </row>
</rows>

And I loop through it with AS finding attributes that define where things go and create the actual XML I use for the datagrid, putting items in their correct areas.

If you do your XML correctly in the page your HTTP service calls you don't even have to parse through it, use the E4X format on the http service and it will take the XML right off the page as a variable.

Edit per comments below:
This page has all you need: http://livedocs.adobe.com/flex/3/html/help.html?content=data%5Faccess%5F2.html

Basically you need to get your php or cf or whatever page to output your XML, which you should be able to google best methods for that, then your httpService needs to include

resultFormat="e4x"

and your result handler will just need to know how to deal with it. All should be in that link.

invertedSpear
my application is in this post:http://stackoverflow.com/questions/1968821/get-data-from-dynamic-httpservice-asynchronous-to-populate-an-advanced-data-gridhow can i manage this?
Franky
Which way would you prefer to manage it? Create the XML in the page your HTTP service calls, or parse through a row dump of your query and create the XML in Flex?
invertedSpear
the first one! it would be amazing if i could call an asynchronous HTTP service which randomly change some random values of the datagrid.That's my project's target!Thank you in advance
Franky
I screwed up posted a code example for the second way, sorry ignore previous example. Will get you an example of the first method here shortly
invertedSpear
Not an example per say, but should point you in the right direction.
invertedSpear
tomorrow i'll try to do it, I hope you will assist me in case i can'tthank you so much
Franky