Hi
I've got a bindable arraycollection in my Application which I use in 2 different places.
I can't seem to get the combo to populate properly. The webservice brings back the results in the resultHandler but they are presented as one item in xml format:
Code:
so if the "geonames" webservice is called with ta.text="BA14"
as follows:
<mx:HTTPService id="postalCodeSearch" url="http://ws.geonames.org/postalCodeSearch?" requestTimeout="10"
useProxy="false" method="GET" showBusyCursor="false" resultFormat="e4x" result="resultHandler(event)" fault="FaultHandler(event)">
<mx:request xmlns="">
<postalcode>{ta.text}</postalcode>
</mx:request>
</mx:HTTPService>
private function resultHandler(evt:ResultEvent):void
{
Application.application.postal_ac = new ArrayCollection(mx.utils.ArrayUtil.toArray(evt.result))
}
private function lfx(item:Object):String
{
var a:String = item.code.name
trace (a)
return a
}
<mx:ComboBox id="cb1" x="113" y="2" dataProvider="{Application.application.postal_ac}" width="158" close="closeHandler(event)" labelFunction="lfx" ></mx:ComboBox>
One big chunk returned as a combobox item not 13 separate items and the <name/> tags are not removed....
<name>Trowbridge</name>
<name>Hilperton</name>
<name>Trowle Common</name>
<name>Ashton Common</name>
<name>Steeple Ashton</name>
<name>Southwick</name>
<name>Great Hinton</name>
<name>Holt</name>
<name>Semington</name>
<name>Wingfield</name>
<name>Keevil</name>
<name>Staverton</name>
<name>North Bradley</name>
<name>Yarnbrook</name>
<name>West Ashton</name>
any ideas?
Thanks in advance.
Kevin