actionscript 3 - Can't populate my drop down with xmldocument -
why can not populate drop down. video @ http://www.adobe.com/devnet/flex/videotraining.html . value not in namesalechoose.how be. please me.
i want show localdesc in drop down.
<?xml version="1.0" encoding="utf-8"?> <s:windowedapplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="320" height="480" creationcomplete="initapp()"> <fx:script> <![cdata[ import mx.collections.arraycollection; import mx.controls.alert; import mx.rpc.events.faultevent; import mx.rpc.events.resultevent; import spark.events.indexchangeevent; [bindable] private var namesalechoose:arraycollection; protected function service_resulthandler(event:resultevent):void { // todo auto-generated method stub namesalechoose = event.result arraycollection; } private function initapp():void { service.getxml("select positioncode,localdesc staffposition positioncode in ('00000','00021')"); } ]]> </fx:script> <fx:declarations> <s:webservice id="service" wsdl="http://192.168.1.25/service.asmx?wsdl" result="service_resulthandler(event)" > </s:webservice> </fx:declarations> <s:dropdownlist id="dropdownlist" x="35" y="38" width="164" dataprovider="{namesalechoose}" labelfield="localdesc"> </s:dropdownlist> this xml: return web service
<?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:xsi="http:// www.w3.org/2001/xmlschema-instance"> <soap:body> <getxmlresponse xmlns="http://tempuri.org/"> <getxmlresult> <newdataset xmlns=""> <table> <positioncode>00000</positioncode> <localdesc>administrator</localdesc> </table> <table> <positioncode>00021</positioncode> <localdesc>saleman</localdesc> </table> </newdataset> </getxmlresult> </getxmlresponse> </soap:body> </soap:envelope>
reason result xml format , try cast in arraycollection. should use xmllistcollection class.
Comments
Post a Comment