EasyCFM.COM ColdFusion Forums / Flex Development / problems with combobox dataprovider

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: problems with combobox dataprovider

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

falconseye
09-29-2009 @ 11:08 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 1033
Joined: Mar 2004

I started learning flex and have the following:


<mx:RemoteObject id="myCFC" destination="ColdFusion" source="components.myCFC"  showBusyCursor="true">
    <mx:method name="getStuff" result="UserHandler(event);"/>
</mx:RemoteObject>
...
<mx:ComboBox id="propertyCode" dataProvider="{qry_stuff}" labelField="name" />


Index.as has:
Bindable] public var qry_stuff:ArrayCollection = new ArrayCollection;
private function UserHandler(event:ResultEvent):void {
   qry_stuff= event.result as ArrayCollection;
}
public function init():void {
  /* call my remote Object to get my data */
   myCFC.getStuff();
  }

my problem is the combobox displays [object Object] for qry_stuff.recordcount many times. what am i doing wrong?


I know there is nothing wrong with the cfc and there is a field called "name" in getStuff.  thanks in advance.

http://www.fuzzysiberians.com

falconseye
09-29-2009 @ 1:19 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 1033
Joined: Mar 2004

http://tutorial14.flexcf.com/

My first function returned a query. I had to write another function just like his getCBData  which creates an array with 'data' and 'label'.

This solved my problem.
thanks

http://www.fuzzysiberians.com


Website Designed and Developed by Pablo Varando.