Skip navigation
Currently Being Moderated

Disabling auto-complete on Spark ComboBox

Aug 4, 2011 5:36 AM

I want to disable the auto-completing of text entered into a ComboBox, but still have it match the text against items in the DropDownList. Is there any easy way to do this?

 
Replies
  • Currently Being Moderated
    Aug 4, 2011 5:43 AM   in reply to RandomReado

    I think you'll have to extend the component to make this work.  I don't believe there is a property to control this behavior.

     
    |
    Mark as:
  • Currently Being Moderated
    May 6, 2012 4:27 PM   in reply to RandomReado

    Those "functionalities" are implemented by the private function processInputField() and the mx_internal function applySelection()

     

    of the ComboBox component. They are either private of mx_internal so you can't override them. I created a new AS class that extends extends DropDownListBase and implements IIMESupport, just like the Spark ComboBox and tweaked the functions, for example I commented this lines:

     

    // textInput.selectAll();

    // textInput.insertText(itemString);

     

    Hope that helps!!

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 11, 2012 5:30 AM   in reply to nvhdab

    Simply create you new combobox class and override the findStringLoop function, it should always return -1 to prohibit the fincding of matching items (for autocomplete reasons).

    Code is the following:

     

                        /**

                         * Disabel the autocomplete option on Spark Combobox

                         **/

                        mx_internal override function findStringLoop(str:String, startIndex:int, stopIndex:int):Number

                        {

                             return -1;

                        }

     
    |
    Mark as:
  • Currently Being Moderated
    May 17, 2013 9:33 AM   in reply to RandomReado

    The easiest solution for me was to use the existing itemMatchingFunction attribute on ComboBox and create a function like the one below retuning an empty Vector array:

     

    protected function comboDisableMatchingFunction(comboBox:ComboBox, inputText:String):Vector.<int>

                                  {

                                            return new Vector.<int>();

                                  }

     
    |
    Mark as:
  • Currently Being Moderated
    May 18, 2013 3:12 PM   in reply to the_brownfoot

    @the_brownfoot

     

    That is the same solution as overriding findStringLoop() method. Hopefully Flex is open source so we can invent workarounds easily

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points