SoFunction
Updated on 2025-04-14

FLEX imitation Google Lenovo box effect


import ;
            import ;
            import ;
            import ;

            import ;

// Rendered association results List
            private var list:Association;
// Temporary string, used to determine whether the value of the associative box has changed when the keyUp event occurs, and if it does not change, it will not be associated.
            private var temp:String = '';
            private function changeAssociation():void{
                temp='';
                ='';
                associationResult=null;
                if(list != null){
                    (list);
                    list = null;
// Clear temporary strings
                }
        }
            private function associate():void {
                var str:String = ;
                if(<2){
                    associationResult=null;
                }
                if (str != temp) {
                    if( < 2){
                         if(list != null){
                             (list);
                             list = null;
// Clear temporary strings
                            temp = '';
                        }
                         return;
                    }
                    temp = str;

                    var params:Object = {};
                    params['areaNO'] = ;
                 params['netType'] = ;
                    params['str'] = str;
                    params['handle'] = 'associate';
                    (params);
                }
            }
            private function openAssociation():void {
                if( != null)
                     createAndShow();

                else if(list != null){
                    (list);
                    list = null;
// Clear temporary strings
                    temp = '';
                }
            }
            private function createAndShow(dp:Object):void {
// Before opening the Lenovo box, clean the cache first
                if(list != null){
// Remove the Lenovo box from PopUpManager
                    (list);
// Clear the Lenovo box example
                    list = null;
                }

                list = new Association();
//Specify data source
                 = dp;
//Get the mouse coordinates and assign the value to the list
                 = + 219;
                 = + 205;
//Size
                 = 400;
                 = 270;
//Register the list external mouse button and project click event
                (FlexMouseEvent.MOUSE_DOWN_OUTSIDE, mouseDownOutsideHandler);
                (ListEvent.ITEM_CLICK, itemClik);

//Pop up and display list
                (list, this, false);
            }
            private var associationResult:Object;
            private function itemClik(event:ListEvent):void{
                associationResult = ArrayCollection(Association().dataProvider).getItemAt();
                 = ;
                //();
                removePopUpIDisplay(Association());
            }
            private function mouseDownOutsideHandler(event:MouseEvent):void{
                removePopUpIDisplay(Association());
            }
            private function removePopUpIDisplay(obj:Association):void{
// Clear temporary strings
                temp = '';
                (FlexMouseEvent.MOUSE_DOWN_OUTSIDE, mouseDownOutsideHandler);
                (obj);
            }
/**----------------------------------------------------------------------------------------------------------------------------