1 Reply Latest reply on Apr 3, 2007 10:49 AM by kdennis4

    ComboxBox Display not showing value

    kdennis4
      I'm sure that this is a quick fix in my code... A user selects a Category Type that is populated from a dropdown, which then calls a CFC to return the Product Values for that Category. Here is what I have:

      [Bindable]
      private var acProductType:ArrayCollection = new ArrayCollection();
      public var pType:Object;

      private function comboSelection(event:Event):void {
      //Alert.show(cboProducts.selectedItem.toString());
      pType = cboProducts.selectedItem;
      dpProducts.getByType(pType);
      }

      private function receiveProducts(event:ResultEvent):void {
      //upon receipt of results set the array collection to the result set received
      acProductType = event.result as ArrayCollection;
      //if there are no records tell the user so he/she is not surprised and thinks there is something wrong;
      if (acProductType.length == 0) {
      //trace("I've arrived in the no states found spot");
      Alert.show("No records were found.");
      }

      <mx:RemoteObject id="dpProducts"
      destination="ColdFusion"
      showBusyCursor="true"
      source="mySource.Products"
      fault="Alert.show(event.fault.faultDetail,'Error');Alert.show(event.fault.faultString,'Er ror');">
      <mx:method name="getByType" result="receiveProducts(event)"/>
      </mx:RemoteObject>

      First ComboBox:
      <mx:ComboBox change="comboSelection(event)" name="cboProducts" id="cboProducts">
      <mx:dataProvider>
      <mx:Array>
      <mx:String>-- SELECT ONE --</mx:String>
      <mx:String>Product</mx:String>
      </mx:Array>
      </mx:dataProvider>
      </mx:ComboBox>

      Second ComboBox:
      <mx:ComboBox id="cboProductType" dataProvider="{acProductType}" labelField="name"/>

      It's outputing: "object Object"???

      Any help would be greatly appreciated!