Hi Rick, You’re right, the display value for
a list must not be an empty string (“”). This is a known issue. Please make use of the prompt property on
the combobox if possible. If this does not work for you, because you
want to allow users de-select their previous selection on a combobox, you
should use a single space character (“ “) as a workaround. This
code sample shows how to do this, if you have no way of making that change on
the server side: <?xml
version="1.0" encoding="utf-8"?> <mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.utils.StringUtil;
import mx.collections.ArrayCollection;
[Bindable]
public var
stateArray:Array = ["", "AL", "AK",
"AZ", "AR", "CA", "CO", "CT",
"DE", "DC", "FL", "GA",
"HI","ID", "IL", "IN", "IA",
"KS", "KY", "LA", "ME", "MD",
"MA", "MI", "MN", "MS", "MO",
"MT", "NE", "NV", "NH", "NJ",
"NM", "NY", "NC", "ND", "OH",
"OK", "OR", "PA", "PR", "RI",
"SC", "SD", "TN", "TX", "UT",
"VT", "VA", "WA", "WV", "WI",
"WY"];
[Bindable]
public var stateInfo:ArrayCollection;
private function modifyData() : void
{
stateInfo = new ArrayCollection();
for(var i:Number=0; i < stateArray.length; i++) {
var item:Object;
if(String(stateArray[i])) {
item = new Object();
item.label = stateArray[i];
stateInfo.addItem(item);
} else {
item = new Object();
item.label = " ";
stateInfo.addItem(item);
}
}
}
]]>
</mx:Script>
<mx:VBox>
<mx:TextInput text="{stateArray.toString()}"/>
<mx:TextInput text="{foo.selectedItem.data}"/>
<mx:ComboBox id="foo" dataProvider="{stateInfo}"
creationComplete="modifyData()" prompt=" " />
</mx:VBox> </mx:Application> As the issue is known there’s no
need to file a new bug. Just in case and for future issues, here’s the
address to our wish form: http://www.adobe.com/support/email/wishform/ Best regards, Patrick From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rick Root so, I
solved this problem. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___ |
- [flexcoders] Re: Disappearing list items Patrick Simon
- Re: [flexcoders] Re: Disappearing list items Douglas Knudsen