<?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 Open a widget from another widget in ArcGIS Viewer for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/open-a-widget-from-another-widget/m-p/489160#M13757</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to use widget containers and widgets for a dynamic legend. I have a data selection widget that allows the user to select data and I have a legend that catches the selection, queries the server, classifies the return information, and renders the graphics on the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to piggyback on the widget and container functionality with the legend. Is there a way to send an open widget event from the selection widget?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-hope this is clear....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 23 Jan 2011 15:37:16 GMT</pubDate>
    <dc:creator>JohnGarvey</dc:creator>
    <dc:date>2011-01-23T15:37:16Z</dc:date>
    <item>
      <title>Open a widget from another widget</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/open-a-widget-from-another-widget/m-p/489160#M13757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to use widget containers and widgets for a dynamic legend. I have a data selection widget that allows the user to select data and I have a legend that catches the selection, queries the server, classifies the return information, and renders the graphics on the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to piggyback on the widget and container functionality with the legend. Is there a way to send an open widget event from the selection widget?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-hope this is clear....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Jan 2011 15:37:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/open-a-widget-from-another-widget/m-p/489160#M13757</guid>
      <dc:creator>JohnGarvey</dc:creator>
      <dc:date>2011-01-23T15:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Open a widget from another widget</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/open-a-widget-from-another-widget/m-p/489161#M13758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;John&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; All you need to do is call a line like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ViewerContainer.dispatchEvent(new AppEvent(AppEvent.WIDGET_RUN, id));&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Where "id" is the sequential numerical id number that is given to your widget when it is loaded. You can guess (trial and error) to find this number or you can add the code below to the ViewerContainer.mxml to find the id for you from the widgets label string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&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; //add this public var
&amp;nbsp;&amp;nbsp; public var _configData:ConfigData;

&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; //Add this line to the postConfigHandler function
&amp;nbsp;&amp;nbsp;&amp;nbsp; _configData = event.data as ConfigData;

&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; //Add this new function
&amp;nbsp;&amp;nbsp; public function getWidgetId(widgetLabel:String):Number
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var id:Number;
&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var i:Number = 0; i &amp;lt; _configData.widgets.length; i++)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (_configData.widgets&lt;I&gt;.label == widgetLabel)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id = _configData.widgets&lt;I&gt;.id;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; return id;
&amp;nbsp;&amp;nbsp; &lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;If you choose to add this code then you would use this line instead to open your widget:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ViewerContainer.dispatchEvent(new AppEvent(AppEvent.WIDGET_RUN, ViewerContainer.getWidgetId("TheLabelOfYourWidget")));&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:31:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/open-a-widget-from-another-widget/m-p/489161#M13758</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T21:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Open a widget from another widget</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/open-a-widget-from-another-widget/m-p/489162#M13759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the response and code, I am glad to see other people working on Sunday.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have any leads on passing data with that event. I am looking at the method that catches the event in the widget manager, but is seems I would have to edit the config data of the widget and then throwing the WIDGET_OPEN event.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I appreciate any suggestions.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Jan 2011 19:13:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/open-a-widget-from-another-widget/m-p/489162#M13759</guid>
      <dc:creator>JohnGarvey</dc:creator>
      <dc:date>2011-01-23T19:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Open a widget from another widget</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/open-a-widget-from-another-widget/m-p/489163#M13760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Best advice I can give is don't be afraid to add your own custom AppEvent. Just make sure you comment you changes so that you can migrate them to the next version of the viewer (which 2.3 is right around the corner).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Jan 2011 23:36:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/open-a-widget-from-another-widget/m-p/489163#M13760</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2011-01-23T23:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Open a widget from another widget</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/open-a-widget-from-another-widget/m-p/489164#M13761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to use this code to open a widget from another, I've added the code to my ViewerContainer, but when I'm trying to access the ViewerContainer.getWidgetId function from another widget I get an error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1061: Call to a possibly undefined method getWidgetId through a reference with static type Class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What could I be doing wrong here, it is a public function and I have an import for com.esri.viewer.ViewerContainer in my widget but still I can't get to that function.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2011 07:35:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/open-a-widget-from-another-widget/m-p/489164#M13761</guid>
      <dc:creator>MattiasEkström</dc:creator>
      <dc:date>2011-03-11T07:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Open a widget from another widget</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/open-a-widget-from-another-widget/m-p/489165#M13762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mattias,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Make sure you use getInstance on the ViewerContainer.&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;ViewerContainer.getInstance().getWidgetId("Enhanced Search");&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2011 12:34:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/open-a-widget-from-another-widget/m-p/489165#M13762</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2011-03-11T12:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Open a widget from another widget</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/open-a-widget-from-another-widget/m-p/489166#M13763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Robert! That was it, I didn't see that part in any code in previous posts.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2011 13:15:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/open-a-widget-from-another-widget/m-p/489166#M13763</guid>
      <dc:creator>MattiasEkström</dc:creator>
      <dc:date>2011-03-11T13:15:49Z</dc:date>
    </item>
  </channel>
</rss>

