<?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: Widget Communication Explained in ArcGIS Viewer for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142165#M4656</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Robert, this is just awasome.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It really had a great insight on Widgets Communication.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Lu.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Sep 2011 09:19:01 GMT</pubDate>
    <dc:creator>NitinBele</dc:creator>
    <dc:date>2011-09-08T09:19:01Z</dc:date>
    <item>
      <title>Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142164#M4655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; I have answered many threads where people are attempting to communicate between widget. So I thought that I would document in detail this previously undocumented portion of the Flex Viewer. In this PDF I explain what happens behind the scenes and provide code examples of what you need to add to your widgets. I also provide code for launching a widget from another widget so you can call a particular public function in the second widget. I hope this helps many.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 18:45:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142164#M4655</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2011-09-06T18:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142165#M4656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Robert, this is just awasome.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It really had a great insight on Widgets Communication.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Lu.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2011 09:19:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142165#M4656</guid>
      <dc:creator>NitinBele</dc:creator>
      <dc:date>2011-09-08T09:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142166#M4657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Robert!&amp;nbsp;&amp;nbsp;&amp;nbsp; I appreciate the time you put into putting this document together for all of us.&amp;nbsp;&amp;nbsp; It will be a great reference!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Frank&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 15:32:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142166#M4657</guid>
      <dc:creator>FrankRoberts</dc:creator>
      <dc:date>2011-09-12T15:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142167#M4658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert per the document I implemented the code as follows to open up a widget&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var id:Number = ViewerContainer.getInstance().widgetManager.getWidgetId(incidentCreateWidget);
&amp;nbsp;&amp;nbsp;&amp;nbsp; var bWidget:IBaseWidget = ViewerContainer.getInstance().widgetManager.getWidget(id, true) as IBaseWidget;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (bWidget){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var vSW:* = bWidget;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vSW.queryFromURL("aaa",2,0);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the above "incidentCreateWidget" is a string variable that is set from the xml for the widget.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It works great the first time the code is run (I'm running it from a button click event), however on the second time it throws the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ReferenceError: Error #1069: Property queryFromURL not found on widgets.FrEditIncident.FrEditIncidentWidget and there is no default value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Where "FrEditIncidentWidget" is the widget being called from the first one, where the code resides.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Frank&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:49:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142167#M4658</guid>
      <dc:creator>FrankRoberts</dc:creator>
      <dc:date>2021-12-11T07:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142168#M4659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Frank,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; So does the FrEditIncidentWidget have a public function called queryFromURL?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2011 17:28:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142168#M4659</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2011-09-14T17:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142169#M4660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, Got it,&amp;nbsp; your right it doesn't have that function, so of course it would fail.&amp;nbsp; So technically, if I just want to launch another widget, from widget "A" I just need this code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var id:Number = ViewerContainer.getInstance().widgetManager.getWidgetId("Widget B");
var bWidget:IBaseWidget = ViewerContainer.getInstance().widgetManager.getWidget(id, true) as IBaseWidget;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then if I want to pass values between the two I just need the following in Widget A:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var msArr:ArrayCollection = new ArrayCollection();
//Add an object or for example a string to the ArrayCollection
msArr.addItem("Text to pass to Widget B");&amp;nbsp;&amp;nbsp;&amp;nbsp; 
addSharedData("MiniSearch_Search", msArr);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And then I can drop this code from Widget A, since I'm not calling a function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
if (bWidget){
var vSW:* = bWidget;
vSW.queryFromURL("aaa",2,0);
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I'm wrong feel free to set me straight.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks yet again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:49:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142169#M4660</guid>
      <dc:creator>FrankRoberts</dc:creator>
      <dc:date>2021-12-11T07:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142170#M4661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Frank,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; All is good, but to clarify on the first code block if you are not going to call a public function on the widget than there is no need to get the base widget returned to you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var id:Number = ViewerContainer.getInstance().widgetManager.getWidgetId("Widget B"); 
AppEvent.dispatch(AppEvent.WIDGET_RUN, id);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The above code is cleaner if you are not calling a function on the widget.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:49:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142170#M4661</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T07:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142171#M4662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am encountering a problem with getting the base widget returned. I have set up function triggered by a checkbox in the Print widget to include the Dynamic Legend. The Dynamic Legend opens as expected, but the code&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; if(bWidget)&lt;/PRE&gt;&lt;SPAN&gt; returns null when I debug, and of course anything after it does not happen. Here is the code I am using &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;private function incLegend():void
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(incLgnd.selected)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var id:Number = ViewerContainer.getInstance().widgetManager.getWidgetId("Dynamic Legend");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var bWidget:IBaseWidget = ViewerContainer.getInstance().widgetManager.getWidget(id,true) as IBaseWidget;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(bWidget){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var vSW:* = bWidget;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vSW.exportImage();}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there something basic that I am missing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jim Faron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:49:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142171#M4662</guid>
      <dc:creator>JamesFaron</dc:creator>
      <dc:date>2021-12-11T07:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142172#M4663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jim,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; The issue is that if the widget you are calling is not already loaded it takes some time to load and thus the bWidget is going to return null. One way to get around this is to use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;addSharedData("Legend_exportImage", null);&lt;/PRE&gt;&lt;SPAN&gt; and implement the part of the document under figure 1.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2011 17:13:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142172#M4663</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2011-09-21T17:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142173#M4664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the advice, but I can't seem to get the necessary exchange of data to happen. I added:&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;private function incLegend():void
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(incLgnd.selected)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addSharedData("Legend_exportImage",null);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var id:Number = ViewerContainer.getInstance().widgetManager.getWidgetId("Dynamic Legend");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var bWidget:IBaseWidget = ViewerContainer.getInstance().widgetManager.getWidget(id,true) as IBaseWidget;&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and then in the Dynamic Legend added:&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;private function sharedDataUpdated2(event:AppEvent):void
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var dataTable:Hashtable = event.data as Hashtable;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(dataTable.containsKey("Legend_exportImage"))
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exportImage();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I debug, the dataTable key in the SharedDataUpdated2 is null. I fire the event listeners on init in the Dyanamic Legend. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jim Faron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:49:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142173#M4664</guid>
      <dc:creator>JamesFaron</dc:creator>
      <dc:date>2021-12-11T07:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142174#M4665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jim,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Which event listener is calling the sharedDataUpdated2 function and are you calling the fetchSharedData in the init function of the dynamic legend widget?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;AppEvent.addListener(AppEvent.DATA_SENT, sharedDataUpdated2);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fetchSharedData();&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:49:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142174#M4665</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T07:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142175#M4666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the Dynamic Legend widget init, I have it as follows:&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;AppEvent.addListener(AppEvent.DATA_PUBLISH, sharedDataUpdated);
&amp;nbsp;&amp;nbsp;&amp;nbsp; AppEvent.addListener(AppEvent.DATA_SENT, sharedDataUpdated2);
&amp;nbsp;&amp;nbsp;&amp;nbsp; fetchSharedData();&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jim Faron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:49:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142175#M4666</guid>
      <dc:creator>JamesFaron</dc:creator>
      <dc:date>2021-12-11T07:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142176#M4667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jim,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Sorry about that if the fetchAllData is going to work than we have to actually send something using the addSharedData instead of null.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var msArr:ArrayCollection = new ArrayCollection();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msArr.addItem("export");
addSharedData("Legend_exportImage",msArr);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:49:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142176#M4667</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T07:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142177#M4668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That was it! Thanks again for all of your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jim Faron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2011 12:30:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142177#M4668</guid>
      <dc:creator>JamesFaron</dc:creator>
      <dc:date>2011-09-22T12:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142178#M4669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is has been very helpful but I have another related question. How does one access a variable within a widget from the root application, say index.mxml. I want to save a sharedObject based on a value in a widget.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;James&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2011 15:17:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142178#M4669</guid>
      <dc:creator>JamesKo</dc:creator>
      <dc:date>2011-09-23T15:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142179#M4670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; I hope that the widget would be loaded already... If that is the case then all you need to do is add these lines to the index.mxml&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var id:Number = ViewerContainer.getInstance().widgetManager.getWidgetId("Your Widget");
var bWidget:IBaseWidget = ViewerContainer.getInstance().widgetManager.getWidget(id,true) as IBaseWidget;
x = bWidget.yourPublicVar;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:49:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142179#M4670</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T07:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142180#M4671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the quick response...I was getting the following error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Access of possibly undefined property 'myPublicVar' through a reference with static type com.esri.viewer.IBaseWidget.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BUT I just added these lines of code to get it working:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var vSW:* = bWidget;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var whatever:String = vSW.myPublicVar;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2011 16:28:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142180#M4671</guid>
      <dc:creator>JamesKo</dc:creator>
      <dc:date>2011-09-23T16:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142181#M4672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert -&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I found your document on inter-widget communictation very useful.&amp;nbsp; However, I get an odd result when I use the following code in an attempt to toggle 2 widgets:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var Widgetw:IBaseWidget = ViewerContainer.getInstance().widgetManager.getWidget(2, false) as IBaseWidget;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; which returns null (as expected) if Widget2 isn't yet open, but the problem is that it ends up launching Widget2 despite the 2nd parameter being set to false. Any ideas? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Bob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2011 21:21:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142181#M4672</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-12-27T21:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142182#M4673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Bob,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; All the openWidgetIfNot parameter does is if the widget is in a minimized state and the openWidgetIfNot is set to also then it does not set the widgets state to maximized/open.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2011 23:38:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142182#M4673</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2011-12-27T23:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Communication Explained</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142183#M4674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert -&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you for your quick response.&amp;nbsp; Given that the code block provided seems to end up having the desired result of launching the second widget if it's not already open, is there any other means of toggling 2 widgets visibility that you could recommend? Thanks again for any suggestions you might have.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Bob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 19:36:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/widget-communication-explained/m-p/142183#M4674</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-12-28T19:36:49Z</dc:date>
    </item>
  </channel>
</rss>

