Ian Skinner wrote:
> Can anybody point me to examples, how-to's, downloads on how to create
> an advanced comboBox where the user can type in a value and the existing
> values are filtered and matched to what is typed until an existing value
> is selected and|or a unique value is entered.
>
> Does that make sense? I'm looking for the standard desktop type combo
> box that tries to best match an existing value before accepting a new
> value.
I have a primitive example that demonstrates somewhat what I am looking
for. This works crudely. The comboBox blinks very obviously with every
key stroke, I presume because of the refresh(). It would also be nice
if the default selection was the first item in the dataProvider, but
with the ability to override this with a new value if necessary.
[Bindable]
private var comboFilterStr:String = new String();
....
private function comboFilter(o:Object):Boolean
{
return comboFilterStr.toUpperCase() ==
o.substr(0,comboFilterStr.length).toUpperCase() ;
}
private function test(ctrl:ComboBox):void
{
comboFilterStr = ctrl.text;
ctrl.dataProvider.filterFunction = comboFilter;
ctrl.dataProvider.refresh();
ctrl.open();
}
....
<mx:ComboBox
id="te_application" change="test(te_application)"
prompt="Select Application"
width="100%"
rowCount="5"
dataProvider="{applicationsAry}"
editable="true"/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf
Archive: http://www.houseoffusion.com/groups/Flex/message.cfm/messageid:4422
Subscription: http://www.houseoffusion.com/groups/Flex/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37