HTTPService: request on a tag/field
hi,
i have following xml file use data source :
<?xml version="1.0" encoding="utf-8"?>
<villes>
<ville>
<nom>paris</nom>
<region>ile-de-france </region>
<departement>paris</departement>
<codepostal>75001</codepostal>
</ville>
<ville>
<nom>bordeaux</nom>
<region>aquitaine</region>
<departement>gironde</departement>
<codepostal>33000</codepostal>
</ville>
</villes>
i have map of france, when user clicks on bordeaux, want display region, aquitaine, in panel.
how request xml file on field (tag) ?
in sql, :
select region ville nom="bordeaux" ==> aquitaine
in code, have these lines :
...
<mx:httpservice id="service" url="data/villes.xml" />
...
<mx:datagrid id="grid" dataprovider="{service.lastresult.villes.ville}" />
...
please not event must display region not on datagrid.
thanks helping.
hi,
it's easier work xml data. can save xml data variable or every time call lastresult service.
for geting data want
var villes:xml = xml(service.lastresult.villes);
var regions:xmllist = villes.ville.(nom == "bordeaux").region; // regions. if regions.length()>0 data founded
<mx:httpservice id="service" url="data/villes.xml" resultformat="e4x"/>
More discussions in Flex (Read Only)
adobe
Comments
Post a Comment