<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Really close a widget Pt.  deux in ArcGIS Viewer for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/really-close-a-widget-pt-nbsp-deux/m-p/616756#M18394</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;O.K. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think that I may have crossed information from two separate versions of the Sample Flex Viewer or misdiagnosed/complicated the issue. There was a flaw in my logic and research that revealed itself last night. I now see that ViewerContainer.dispatchEvent(new AppEvent(AppEvent.WIDGET_CHANGE_STATE, {id: this.widgetId, state:WidgetStates.WIDGET_CLOSED})); does close the widget, at least to the extent I need for my program. I really had a different problem and some testing and research indicated the design I was implementing was flawed from the get go. A quick redesign has me back on track. Thanks for bearing with me. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tyler&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Jun 2011 12:13:38 GMT</pubDate>
    <dc:creator>TylerWaring</dc:creator>
    <dc:date>2011-06-21T12:13:38Z</dc:date>
    <item>
      <title>Really close a widget Pt.  deux</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/really-close-a-widget-pt-nbsp-deux/m-p/616751#M18389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings. This is a continuation of the origional post "Really Close a Widget" (&lt;/SPAN&gt;&lt;A href="http://forums.esri.com/thread.asp?c=158&amp;amp;f=2421&amp;amp;t=302669"&gt;http://forums.esri.com/thread.asp?c=158&amp;amp;f=2421&amp;amp;t=302669&lt;/A&gt;&lt;SPAN&gt;). Great stuff. However there are a few conceptual leaps required by the solution that I am not yet equiped to make. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Solution:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public function closeWidget(id:Number, url:String):void&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (widgetTable.containsKey(id))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var widget0:IBaseWidget = widgetTable.find(id) as IBaseWidget;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var wObj0:DisplayObject = widget0 as DisplayObject;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; widgetTable.remove(id);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(widgetBox.contains(wObj0))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; widgetBox.removeChild(wObj0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (moduleTable.containsKey(url))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var modInfo:IModuleInfo = moduleTable.find(url) as IModuleInfo;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; moduleTable.remove(url);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; modInfo.unload();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Conceptual Leaps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Where does this funciton belong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. How do you reference the widgetTable and moduleTable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. How do you reference the widgetBox. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I realize that this is probably pretty complex to explain so any more hints to get me in the right direction will be greatly appreciated. ViewerContainer.dispatchEvent(new AppEvent(AppEvent.WIDGET_CHANGE_STATE, {id: this.widgetId, state:WidgetStates.WIDGET_CLOSED})); is not the appropriate way to close the widget if you wish to reloas the config file. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tyler&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2011 01:39:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/really-close-a-widget-pt-nbsp-deux/m-p/616751#M18389</guid>
      <dc:creator>TylerWaring</dc:creator>
      <dc:date>2011-06-08T01:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Really close a widget Pt.  deux</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/really-close-a-widget-pt-nbsp-deux/m-p/616752#M18390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Tyler,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; If you put this function in the WidgetManager.mxml it will have the links it needs to the widgetTable, moduleTable, and widgetBox.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2011 14:02:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/really-close-a-widget-pt-nbsp-deux/m-p/616752#M18390</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2011-06-08T14:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Really close a widget Pt.  deux</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/really-close-a-widget-pt-nbsp-deux/m-p/616753#M18391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Robert. Where would my projects be without your replies to my and other people's posts? I have loaded this function into the WidgetManager but widgetBox is not declared in the WidgetManager (Flex Viewer 2.2). Any suggestions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2011 17:04:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/really-close-a-widget-pt-nbsp-deux/m-p/616753#M18391</guid>
      <dc:creator>TylerWaring</dc:creator>
      <dc:date>2011-06-08T17:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Really close a widget Pt.  deux</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/really-close-a-widget-pt-nbsp-deux/m-p/616754#M18392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Tyler,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; I did not write that code for the new flex viewer and did not consider that the widgetbox is no longer in the WidgetManager.mxml but now the widgetContainer is a group in the WidgetContainer.mxml and is very different now.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2011 17:12:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/really-close-a-widget-pt-nbsp-deux/m-p/616754#M18392</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2011-06-08T17:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Really close a widget Pt.  deux</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/really-close-a-widget-pt-nbsp-deux/m-p/616755#M18393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a way to reference the widgetBox or is this line of logic a not the way to truely close a widget? I am having issues with my program because i can not really close a widget. Thanks. Tyler&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 11:55:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/really-close-a-widget-pt-nbsp-deux/m-p/616755#M18393</guid>
      <dc:creator>TylerWaring</dc:creator>
      <dc:date>2011-06-13T11:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Really close a widget Pt.  deux</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/really-close-a-widget-pt-nbsp-deux/m-p/616756#M18394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;O.K. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think that I may have crossed information from two separate versions of the Sample Flex Viewer or misdiagnosed/complicated the issue. There was a flaw in my logic and research that revealed itself last night. I now see that ViewerContainer.dispatchEvent(new AppEvent(AppEvent.WIDGET_CHANGE_STATE, {id: this.widgetId, state:WidgetStates.WIDGET_CLOSED})); does close the widget, at least to the extent I need for my program. I really had a different problem and some testing and research indicated the design I was implementing was flawed from the get go. A quick redesign has me back on track. Thanks for bearing with me. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tyler&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2011 12:13:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/really-close-a-widget-pt-nbsp-deux/m-p/616756#M18394</guid>
      <dc:creator>TylerWaring</dc:creator>
      <dc:date>2011-06-21T12:13:38Z</dc:date>
    </item>
  </channel>
</rss>

