How to close a widget completely in flex viewer 2.4?
clicking the "x" in upper right is not closing the widget completely. I need to close a widget and open it newly (need to get initialize and widgetConfigLoaded events)
tried the below code in my widget but doesn't seem to work. Next time when I open the widget, it is not even capturing the events initialize and widgetConfigLoaded.
//open the widget
AppEvent.dispatch(AppEvent.WIDGET_RUN,ViewerContainer.getInstance().getWidgetId("MyWidget"));
//close the widget (closed="widgetClosedHandler(event)")
private function widgetClosedHandler(event:Event):void
{
AppEvent.dispatch(AppEvent.WIDGET_CHANGE_STATE,{id:this.widgetId,State:WidgetStates.WIDGET_CLOSED});
}
any help?