A problem for a widget with preload="minimized"

732
1
Jump to solution
04-26-2013 09:22 AM
ShaningYu
Frequent Contributor
Got a problem for a widget with preload="minimized".  After the widget is opened and then closed, it does not return to "minimized" state.  But this widget's icon on the toolbar is still underlined with a yellow bar, and this widget is actually disappeared on the UI.
I believe that the problem is caused by the approach as described below:
I set each widget id (e.g. the widget below id="3"), and then run the even below (revised the code from Robert) in the widget.  Once some widgets are closed, the actual id may change and then it causes the problem.
Therefore, I am considering in the event below, if the opened widget can be identified not by widget id (that defined in config.xml should be removed), this problem may be solvable.
Welcome your solution for it.  Thanks.

----------

   private function wTemplate_openHandler(event:Event):void {
    for each (var widgetId:Number in ViewerContainer.getInstance().widgetManager.getAllLoadedWidgetIds()) {
     if(widgetId != 3) {
      var data:Object = {
       id: widgetId,
       state: WidgetStates.WIDGET_MINIMIZED
      };
      AppEvent.dispatch(AppEvent.WIDGET_CHANGE_STATE, data);
     }
    }
   }
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
ShaningYu
Frequent Contributor
0 Kudos
1 Reply
ShaningYu
Frequent Contributor
Problem solved.
0 Kudos