Im attaching the file i have used to debug ur code......In case if u need it
On Fri, Aug 21, 2009 at 8:42 AM, Preetham Hegde <[email protected]>wrote: > Hi i have made some changes in ur code(). Its working fine now. > You were inserting a array inside arraycollection instead of object( Line > number 30). so it was not reachable.... > Anyway see the code you will understand > > > * > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > creationComplete="viewConcentration.getListElements()" > > <mx:Script> > <![CDATA[ > import mx.utils.ArrayUtil; > > import mx.rpc.events.ResultEvent; > import mx.rpc.events.FaultEvent; > import mx.collections.ArrayCollection; > import mx.controls.Alert; > import mx.utils.ObjectUtil; > > //hardcoded the view values > [Bindable] > public var expenseArrayCol:ArrayCollection; > [Bindable] > public var collection:ArrayCollection; > [Bindable] > public var piedata:ArrayCollection; > > private function > resultHandler(event:ResultEvent):void > { > collection=new ArrayCollection(); > expenseArrayCol=event.result as > ArrayCollection; > var obj:Object=expenseArrayCol[0]; > for (var key:String in obj) > { > var data:String = obj[key] > ; > // Alert.show(data); > > collection.addItem({name:key,percents:new Number(data)}); > } > Alert.show( > ObjectUtil.toString(collection)); > > } > private function faultHandler(event:FaultEvent):void > { > Alert.show("inside fault" ); > } > > ]]> > </mx:Script> > > <mx:RemoteObject id="viewConcentration" destination="viewConc" > showBusyCursor="true"> > <mx:method name="getListElements" > result="resultHandler(event)" > fault="faultHandler(event)"/> > </mx:RemoteObject> > > <mx:Panel y="0" width="1000" height="600" layout="vertical" > title="Test Flex 3 Using Java" borderColor="#008040" > fontFamily="Arial" fontWeight="bold" fontSize="13" > horizontalAlign="center" verticalAlign="middle" x="0"> > > <mx:PieChart id="pie" dataProvider="{collection}" > showDataTips="true" height="295" > > <mx:series> > <mx:PieSeries field="percents" nameField="name" > labelPosition="callout"/> > </mx:series> > > </mx:PieChart> > <mx:Legend dataProvider="{pie}"/> > </mx:Panel> > </mx:Application> > * > * > * > > > On Fri, Aug 21, 2009 at 2:58 AM, swap <[email protected]> wrote: > >> >> This is my mxml : >> >> >> <?xml version="1.0" encoding="utf-8"?> >> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >> creationComplete="viewConcentration.getListElements()" > >> <mx:Script> >> <![CDATA[ >> import mx.utils.ArrayUtil; >> >> import mx.rpc.events.ResultEvent; >> import mx.rpc.events.FaultEvent; >> import mx.collections.ArrayCollection; >> import mx.controls.Alert; >> import mx.utils.ObjectUtil; >> >> //hardcoded the view values >> [Bindable] >> public var expenseArrayCol:ArrayCollection; >> [Bindable] >> public var collection:ArrayCollection; >> [Bindable] >> public var piedata:ArrayCollection; >> >> private function >> resultHandler(event:ResultEvent):void >> { >> collection=new ArrayCollection(); >> expenseArrayCol=event.result as >> ArrayCollection; >> var obj:Object=expenseArrayCol[0]; >> for (var key:String in obj) >> { >> var data:String = obj[key] >> ; >> // Alert.show(data); >> >> collection.addItem([{name:key,percent:new Number(data)}]); >> } >> Alert.show( >> ObjectUtil.toString(collection)); >> >> } >> private function >> faultHandler(event:FaultEvent):void >> { >> Alert.show("inside fault" ); >> } >> >> ]]> >> </mx:Script> >> >> <mx:RemoteObject id="viewConcentration" destination="viewConc" >> showBusyCursor="true"> >> <mx:method name="getListElements" >> result="resultHandler(event)" >> fault="faultHandler(event)"/> >> </mx:RemoteObject> >> >> <mx:Panel y="0" width="1000" height="600" layout="vertical" >> title="Test Flex 3 Using Java" borderColor="#008040" >> fontFamily="Arial" fontWeight="bold" fontSize="13" >> horizontalAlign="center" verticalAlign="middle" x="0"> >> >> <mx:PieChart id="pie" dataProvider="{collection}" >> showDataTips="true" height="295" > >> <mx:series> >> <mx:PieSeries field="percent" nameField="name" >> labelPosition="callout"/> >> </mx:series> >> >> </mx:PieChart> >> <mx:Legend dataProvider="{pie}"/> >> </mx:Panel> >> </mx:Application> >> >> >> The alert "Alert.show( ObjectUtil.toString(collection));" gives me the >> following output: >> >> (mx.collections::ArrayCollection)#0 >> filterFunction = (null) >> length = 3 >> list = (mx.collections::ArrayList)#1 >> length = 3 >> source = (Array)#2 >> [0] (Array)#3 >> [0] (Object)#4 >> name = "GBP" >> percent = 30 >> [1] (Array)#5 >> [0] (Object)#6 >> name = "USD" >> percent = 40 >> [2] (Array)#7 >> [0] (Object)#8 >> name = "INR" >> percent = 30 >> uid = "DCDB3FB1-7588-85BB-8668-39B48DCDB472" >> sort = (null) >> source = (Array)#2 >> >> which tells me that there is data in the ArrayCollection. >> But it dosent display the pie chart. >> Any pointers will be appreciated. >> >> Thanks >> >> >> >> > > > -- > Regards, > Preetham Hegde > www.dizzianer.com > > _______________________________________________ > If you only have a hammer, you tend to see every problem as a nail. > > -- Regards, Preetham Hegde www.dizzianer.com _______________________________________________ If you only have a hammer, you tend to see every problem as a nail. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---
test.mxml
Description: Binary data

