for each (var widgetId:Number in ViewerContainer.getInstance().widgetManager.getAllLoadedWidgetIds()) { if(ViewerContainer.getInstance().widgetManager.getWidget(widgetId).widgetTitle == "WidgetA") AppEvent.dispatch(AppEvent.WIDGET_CLOSE, widgetId); }
Solved! Go to Solution.
<viewer:WidgetTemplate id="wTemplate" open="wTemplate_openHandler(event)" width="300" height="300" closed="AppEvent.dispatch(AppEvent.TOC_HIDDEN)" minimized="AppEvent.dispatch(AppEvent.TOC_HIDDEN)">
import com.esri.viewer.ViewerContainer; protected function wTemplate_openHandler(event:Event):void { for each (var widgetId:Number in ViewerContainer.getInstance().widgetManager.getAllLoadedWidgetIds()) { if(ViewerContainer.getInstance().widgetManager.getWidget(widgetId).widgetTitle == "WidgetA") AppEvent.dispatch(AppEvent.WIDGET_CLOSE, widgetId); } }
<viewer:WidgetTemplate id="wTemplate" open="wTemplate_openHandler(event)" width="300" height="300" closed="AppEvent.dispatch(AppEvent.TOC_HIDDEN)" minimized="AppEvent.dispatch(AppEvent.TOC_HIDDEN)">
import com.esri.viewer.ViewerContainer; protected function wTemplate_openHandler(event:Event):void { for each (var widgetId:Number in ViewerContainer.getInstance().widgetManager.getAllLoadedWidgetIds()) { if(ViewerContainer.getInstance().widgetManager.getWidget(widgetId).widgetTitle == "WidgetA") AppEvent.dispatch(AppEvent.WIDGET_CLOSE, widgetId); } }