dropdown list does not show its values

£可爱£侵袭症+ 提交于 2019-12-04 16:45:15
David Goshadze

Check xmlns namspace.

the following code i wrote to emulate your problem works fine:

<?xml version="1.0" encoding="utf-8"?>

    <![CDATA[
        import mx.collections.XMLListCollection;
        import mx.events.FlexEvent;
        import mx.messaging.messages.SOAPMessage;
        [Bindable]
        var _result:*;

        protected function  
            dropDownList_creationCompleteHandler(event:FlexEvent):void
        {
            var xml:XML = <Body>
                            <myusersResponse>
                              <myusersReturn>
                                <name>Nicole</name>
                                <age>50</age>
                              </myusersReturn>
                              <myusersReturn>
                                <name>Jayne</name>
                                <age>40</age>
                              </myusersReturn>
                               <myusersReturn>
                                <name>Alex</name>
                                <age>33</age>
                              </myusersReturn>
                            </myusersResponse>
                          </Body>;

        _result = new XMLListCollection(new XMLList(xml.myusersResponse.myusersReturn));
        }

    ]]> 
</fx:Script>

<fx:Declarations>

</fx:Declarations>

<s:FormItem label="Label">
    <s:DropDownList id="dropDownList"
                    creationComplete="dropDownList_creationCompleteHandler(event)"
                    labelField="name">
        <s:AsyncListView list="{_result}"/>
    </s:DropDownList>
</s:FormItem>

But if you add xmlns="http://Services.com to myusersResponse tag it fails.

EDIT: In case you need namespace workaround, I just answered Jack Moores question with namespace solution here My flex code does not parse the soap response properly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!