Spark Multiselect DropDownList

I needed a DropDownList with multiselect capability and wasn't entirely impressed with Googles offerings. Wondering why the DropDownList doesn't support this in the first place (after all, DropDownListBase does extend List which has this feature), I discovered this intriguing comment in the source code:

Actionscript:
  1. override public function set allowMultipleSelection(value:Boolean):void
  2. {
  3. // Don't allow this value to be set. If the multiple
  4. // selection related properties are set and
  5. // allowMultipleSelection is false, List will
  6. // select the first item passed in.
  7. return;
  8. }

After a brief attempt at manipulating the original component, I got annoyed and wrote a simple one which full fills my needs.  I know, "No blog post for years and all we get is a lousy flex component?". Such is life. I'm sure the same code has been written a 100 times by others, but I thought I'd share it anyway.

Click for a demo

Right click the demo to view source.

Download MultiSelectDropDownList.mxml

2 Responses to “Spark Multiselect DropDownList”

  1. Ron Jeremy Says:

    I AM VERY HAPPY!

  2. GuanYuxin Says:

    After a brief attempt at manipulating the original component, I got annoyed and wrote a simple one which full fills my needs.
    –a wise plan
    original component is a mess

Leave a Reply