Widget state not shown correctly after Minimize + Open It

502
1
07-21-2011 07:27 AM
Marlon_JoséLópez_Meza
New Contributor

Grettings,

I've developing a widget with some custom states. the interaction between each custom state were handled by mouse events, but then I minimize the widget and ok, but when I open (after i minimized it) the last state is not appied, specifically, some properties (width, height, etc) of the widget are restored to the defaults (from BaseWidget class).

:confused: My question: how do I control the custom states that I define and how to mantain them after i minimize/open the widget?
Tags (2)
0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus
Marlon,

   You need to ask Flex Viewer Questions in the Flex Viewer forum.

http://forums.arcgis.com/forums/111-ArcGIS-Viewer-for-Flex

The answer is that you need to reset the state of your widget to your custom state in the widgetOpenedHandler function.

private function widgetOpenedHandler(event:Event):void
            {
                if (graphicsLayer)
                    graphicsLayer.visible = true;
                
                 wTemplate.addEventListener(EffectEvent.EFFECT_END, checkHgt2);
                function checkHgt2(event:Event):void
                {
                    if (currentState == "stateForcast"){
                        showStateForcast();
                    } else if (currentState == "stateRadar"){
                        showStateRadar();
                    } else if (currentState == "stateResult"){
                        showStateResults();
                    }else if (currentState == "stateSearch"){
                        showStateTextSearch();
                    }
                    wTemplate.removeEventListener(EffectEvent.EFFECT_END, checkHgt2);
                } 
            }
0 Kudos