Hi Nitin,

Thanks for the code. It is selecting multiple. Its highlighting. But its not 
closing up the dropdown. Any idea why?? 

Thanks,

Anoop P. K.   
 

-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of Nitind
Sent: Friday, March 13, 2009 2:24 PM
To: Flex India Community
Subject: [flex_india:20392] Re: Multiselect DropDown


I had developed one where the renderer contained a checkbox.

It did bot show highlights on all the sekected


This is the code.

See if it might help
package com
{
        import flash.events.Event;
        import flash.events.KeyboardEvent;
        import flash.events.MouseEvent;

        import mx.controls.ComboBox;
        import mx.events.ListEvent;
        public class WorkflowComboBox extends ComboBox
        {
                private var ctrlKey:Boolean = false;

                public function WorkflowComboBox()
                {
                        super();
                        //dropdown.addEventListener(MouseEvent.ROLL_OUT, 
mouseOutHandler);
                }

                public function mouseOutHandler(e:MouseEvent):void
                {
                        super.close()
                }
                override public function close(trigger:Event=null) : void
                {

                        //if(dropdown.mo)
                        /* if ( !ctrlKey )*/
                        if(dropdown.visible == false)
                                super.close( trigger );

                }

                override protected function keyDownHandler(event:KeyboardEvent) 
:
void
                {
                        super.keyDownHandler( event );
                        ctrlKey = event.ctrlKey;
                        if ( ctrlKey )
                                dropdown.allowMultipleSelection = true;
                }

                override protected function keyUpHandler(event:KeyboardEvent) : 
void
                {
                        super.keyUpHandler( event );
                        ctrlKey = event.ctrlKey;

                        if ( !ctrlKey )
                        {
                                close();
                                var changeEvent:ListEvent = new ListEvent( 
ListEvent.CHANGE )
                                dispatchEvent( changeEvent );
                        }
                }

                public function set selectedItems( value:Array ) : void
                {
                        if ( dropdown )
                                dropdown.selectedItems = value;
                }

                [Bindable("change")]
                public function get selectedItems( ) : Array
                {
                        if ( dropdown )
                                return dropdown.selectedItems;
                        else
                                return null;
                }

                public function set selectedIndices( value:Array ) : void
                {
                        if ( dropdown )
                                dropdown.selectedIndices = value;
                }

                [Bindable("change")]
                public function get selectedIndices( ) : Array
                {
                        if ( dropdown )
                                return dropdown.selectedIndices;
                        else
                                return null;
                }



        }

}

Thanks and Regards
Nitin

On Mar 12, 6:47 pm, Anoop Max
<[email protected]> wrote:
> Hi All,
>
> We are using Flex 2 for our application and now am facing a
> requirement where I need to implement multiselect dropdown, which I
> guess is not there in Flex2 combo box. I tried to extend current combo
> box control, but its creating lots of trouble, when I call change
> event. It would be a great help for me if somebody had already
> developed such a combo box or have such code somewhere in the net.
> Please help.
>
> Thanks in advance,
>
> Happy Coding,
> Anoop




DISCLAIMER:
This message contains privileged and confidential information and is intended 
only for an individual named. If you are not the intended recipient, you should 
not disseminate, distribute, store, print, copy or deliver this message. Please 
notify the sender immediately by e-mail if you have received this e-mail by 
mistake and delete this e-mail from your system. E-mail transmission cannot be 
guaranteed to be secure or error-free as information could be intercepted, 
corrupted, lost, destroyed, arrive late or incomplete or contain viruses. The 
sender, therefore,  does not accept liability for any errors or omissions in 
the contents of this message which arise as a result of e-mail transmission. If 
verification is required, please request a hard-copy version.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to