Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>coming from here <a href="https://stackoverflow.com/questions/14314467/dropdown-list-does-not-show-its-values/14319106#14319106">dropdown list does not show its values</a> I slightly modified my example. There are two opportunities:</p> <ol> <li><p>Strip namespace from xml</p></li> <li><p>Utilize namespace</p></li> </ol> <p>Those are shown in dropDownList and dropDownList2 code respectively.</p> <p>Note, that you can not utilize namespace still using labelField property(at least I couldn't find a way). You have to use labelFunction to extract label.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; </code></pre> <p> </p> <pre><code> &lt;![CDATA[ import mx.collections.XMLListCollection; import mx.events.FlexEvent; import mx.messaging.messages.SOAPMessage; [Bindable] var _result:*; [Bindable] var _result2:*; protected function dropDownList_creationCompleteHandler(event:FlexEvent):void { var xml:XML = &lt;Body&gt; &lt;myusersResponse xmlns="http://Services.com"&gt; &lt;myusersReturn&gt; &lt;name&gt;Nicole&lt;/name&gt; &lt;age&gt;50&lt;/age&gt; &lt;/myusersReturn&gt; &lt;myusersReturn&gt; &lt;name&gt;Jayne&lt;/name&gt; &lt;age&gt;40&lt;/age&gt; &lt;/myusersReturn&gt; &lt;myusersReturn&gt; &lt;name&gt;Alex&lt;/name&gt; &lt;age&gt;33&lt;/age&gt; &lt;/myusersReturn&gt; &lt;/myusersResponse&gt; &lt;/Body&gt;; var xmlString:String = xml.toXMLString(); var patt:RegExp = new RegExp("xmlns[^\"]*\"[^\"]*\"", "gi"); var newXmlString:String = xmlString.replace(patt, ""); xml = new XML(newXmlString); _result = new XMLListCollection(xml.myusersResponse.myusersReturn); } protected function dropDownList2_creationCompleteHandler(event:FlexEvent):void { var xml:XML = &lt;Body&gt; &lt;myusersResponse xmlns="http://Services.com"&gt; &lt;myusersReturn&gt; &lt;name&gt;Nicole&lt;/name&gt; &lt;age&gt;50&lt;/age&gt; &lt;/myusersReturn&gt; &lt;myusersReturn&gt; &lt;name&gt;Jayne&lt;/name&gt; &lt;age&gt;40&lt;/age&gt; &lt;/myusersReturn&gt; &lt;myusersReturn&gt; &lt;name&gt;Alex&lt;/name&gt; &lt;age&gt;33&lt;/age&gt; &lt;/myusersReturn&gt; &lt;/myusersResponse&gt; &lt;/Body&gt;; var ns:Namespace = new Namespace("http://Services.com"); _result2 = new XMLListCollection(xml.ns::myusersResponse.ns::myusersReturn); } private function dropDownList2_labelFunction(item:Object):String{ var itemXml:XML = item as XML; var ns:Namespace = new Namespace("http://Services.com"); return item.ns::name; } ]]&gt; &lt;/fx:Script&gt; &lt;fx:Declarations&gt; &lt;/fx:Declarations&gt; &lt;s:FormItem label="Label"&gt; &lt;s:DropDownList id="dropDownList" creationComplete="dropDownList_creationCompleteHandler(event)" labelField="name"&gt; &lt;s:AsyncListView list="{_result}"/&gt; &lt;/s:DropDownList&gt; &lt;s:DropDownList id="dropDownList2" creationComplete="dropDownList2_creationCompleteHandler(event)" labelFunction="dropDownList2_labelFunction"&gt; &lt;s:AsyncListView list="{_result2}"/&gt; &lt;/s:DropDownList&gt; &lt;/s:FormItem&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload