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.
Untitled-1-0002-ac-that-doesnt-w.jpg
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";
}
}
Untitled-1-0001-ac-that-works.jpgUntitled-1-0002-ac-that-doesnt-w.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you
ASKER
result mx.utils.ObjectProxy (@1aeefa19)
object Object (@1af72769)
options mx.utils.ObjectProxy (@1aeefc59)
object Object (@1af90061)
optionTypeName mx.collections.ArrayCollec
[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"