PDA

View Full Version : ComboBox - dropdown is empty


lgrains
11-13-2008, 04:36 AM
I have a ComboBox that is filled dynamically. The drop-down shows up the correct size - it should have 3 items in it, but the item text doesn't show up. However, when I select the space where an item should be, the correct string shows up in the ComboBox.

Here's the definition:

<mx:FormItem required="true" label="Key Number">
<mx:ComboBox id="keyNumCB"
alternatingItemColors="[#CCCCCC, #FFFFFF]"
width="100"/>


I added the alternatingItemColors so that I could see that there were 3 placeholders in the ComboBox.

The data provider is set in the following code:

private function extractKeyNums():void{
for each (var p:XML in wsdlCall..LicenseKey){
trace("134 " + p.text())
keyArray.push(p.text());
}
keyArray=removeDuplicates(keyArray);
keyNumCB.dataProvider = keyArray;

trace("246 " + keyArray) //produces 246 0162341,0200015,0200362
trace("247 " + keyArray.length); //produces 247 3
}

When the screen first comes up, I see "0162341" in the ComboBox. When I click it, I see alternating strips of white and gray in the drop-down, but no text. However, clicking on the 2nd or 3rd strip loads 0200015 and 0200362 into the ComboBox, respectively.

So it appears that somehow the numbers are there, just not visible. I've played with the background colors to see if somehow I had white on white, but that didn't help.

The ComboBox is inside a FormItem, Form, and a Panel, but I have placed it outside the Panel and I get the same behavior. Setting values for the other attributes of the ComboBox hasn't produced any results. In addition, if I use an array of strings as the dataProvider rather than setting it dynamically, the drop-down isn't empty.

Any idea what is going on here?

Thanks in advance!
LG

lgrains
11-13-2008, 04:39 AM
I have a ComboBox that is filled dynamically. The drop-down shows up the correct size - it should have 3 items in it, but the item text doesn't show up. However, when I select the space where an item should be, the correct string shows up in the ComboBox.

Here's the definition:

<mx:FormItem required="true" label="Key Number">
<mx:ComboBox id="keyNumCB"
alternatingItemColors="[#CCCCCC, #FFFFFF]"
width="100"/>


I added the alternatingItemColors so that I could see that there were 3 placeholders in the ComboBox. The attached .jpg shows the empty drop-down.

The data provider is set in the following code:

private function extractKeyNums():void{
for each (var p:XML in wsdlCall..LicenseKey){
trace("134 " + p.text())
keyArray.push(p.text());
}
keyArray=removeDuplicates(keyArray);
keyNumCB.dataProvider = keyArray;

trace("246 " + keyArray) //produces 246 0162341,0200015,0200362
trace("247 " + keyArray.length); //produces 247 3
}

When the screen first comes up, I see "0162341" in the ComboBox. When I click it, I see alternating strips of white and gray in the drop-down, but no text. However, clicking on the 2nd or 3rd strip loads 0200015 and 0200362 into the ComboBox, respectively.

So it appears that somehow the numbers are there, just not visible. I've played with the background colors to see if somehow I had white on white, but that didn't help.

The ComboBox is inside a FormItem, Form, and a Panel, but I have placed it outside the Panel and I get the same behavior. Setting values for the other attributes of the ComboBox hasn't produced any results. In addition, if I use an array of strings as the dataProvider rather than setting it dynamically, the drop-down isn't empty.

Any idea what is going on here?

Thanks in advance!
LG

Jerry62712
11-13-2008, 03:03 PM
When I try the alternating colors, the drop down displays the first one in the color and the second in black. When I mouse over the second, it turns to the color I had put in the alternating sequence.

Perhaps related to your problem?