Link to home
Start Free TrialLog in
Avatar of rarid122481
rarid122481

asked on

I want to generate combo boxes dynamically in Flex 3 with an ArrayCollection, having success until returning only one record

When my arraycollection returns more than one row, i have success generating my dynamic text fields and combo boxes. I am attaching code and screen shots.
private function skuOptionsHandler(event:ResultEvent):void
		{
			acOptionTypeName = event.result.options.optionTypeName as ArrayCollection;
			for(var i:int; i < acOptionTypeName.length; i++)
			{
				var optText:Text = new Text();
				optText.x = optTextX;
				optText.y = optTextY;
				details.addChild(optText);
				optTextY += 30;
				optText.text = acOptionTypeName[i].name + ": ";
				
				var optCombo:ComboBox = new ComboBox();
				optCombo.x = optComboX;
				optCombo.y = optComboY;
				details.addChild(optCombo);
				optComboY += 30;
				acOptionArray = event.result.options.optionTypeName[i].option as ArrayCollection;
				optCombo.dataProvider = acOptionArray;
				optCombo.labelField = "value";
				//optCombo.value = "id";
			}
		}

Open in new window

Untitled-1-0001-ac-that-works.jpg
Untitled-1-0002-ac-that-doesnt-w.jpg
Avatar of rarid122481
rarid122481

ASKER

when i debug, i complex string is returned instead of the needed arraycollection

result      mx.utils.ObjectProxy (@1aeefa19)      
      object      Object (@1af72769)      
      options      mx.utils.ObjectProxy (@1aeefc59)      
            object      Object (@1af90061)      
            optionTypeName      mx.collections.ArrayCollection (@1af5f081)      
                  [inherited]      
                  [0]      mx.utils.ObjectProxy (@1aeefce9)      
                  [1]      mx.utils.ObjectProxy (@1aeefd79)      
                  [2]      mx.utils.ObjectProxy (@1aeefe51)      
                  [3]      mx.utils.ObjectProxy (@1aeeff29)      
                        name      "Drill Bit Type"      
                        object      Object (@1af90c91)      
                        option      ComplexString (@e8b6311)      
                              id      294 [0x126]      
                              value      "French Backfill"      
ASKER CERTIFIED SOLUTION
Avatar of moagrius
moagrius
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank you