<?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: onReceiveData from the Search widget is not working. in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786283#M3640</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone been able to test this and see if they can receive data in the Search widget?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Aug 2020 11:39:30 GMT</pubDate>
    <dc:creator>MartinOwens1</dc:creator>
    <dc:date>2020-08-17T11:39:30Z</dc:date>
    <item>
      <title>onReceiveData from the Search widget is not working.</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786277#M3634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone had an issue trying to receive data in the Search widget? I have attempted to publish from multiple other widgets with no luck. Is there something I'm missing on this particular widget?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;  startup&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
		&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;fetchData&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; 
		&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;fetchDataByName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Query'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;inherited&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arguments&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;     onReceiveData&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; widgetId&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; data&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
		&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;parID&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;target &lt;SPAN class="operator token"&gt;===&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Search"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
          
		parID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; data&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Search ParID data from Query '&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; parID&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
      &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:58:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786277#M3634</guid>
      <dc:creator>MartinOwens1</dc:creator>
      <dc:date>2021-12-12T08:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: onReceiveData from the Search widget is not working.</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786278#M3635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;the Search widget already has an onReceiveData function... Did you replace that functions contents with&amp;nbsp;what you show above?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2020 21:23:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786278#M3635</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-08-13T21:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: onReceiveData from the Search widget is not working.</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786279#M3636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems to me that the order that the widgets are been created is causing the problem. Probably Search widget is been created before the other widgets.&amp;nbsp;If this is the case, it seems that&amp;nbsp;this.fetchDataByName('Query') will not find the widget Query because it doesn't exists yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you should try to use dojo/topic module to solve this problem.&amp;nbsp; You'll probably do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;//Search/Widget.js
startup&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;:&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;function&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt; &lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;this&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #d74444; border: 0px; font-weight: inherit;"&gt;inherited&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;arguments&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;topic.subscribe('query', lang.hitch(this, this.whenQueryPublishesDo));
  //...
},
whenQueryPublishesDo: function(data){
&amp;nbsp;&amp;nbsp;&amp;nbsp;//...process data
   console.log(data.result)
},&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;CODE&gt;//Query/Widget.js
define([
   'dojo/topic',
    //....
]), function(
    topic,
&lt;/CODE&gt;&lt;/CODE&gt;&lt;CODE&gt;    //...
)
//...
&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;someMethod:&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;function&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt; &lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;var data = {
     result : { 
       //...
     }
   };&lt;/SPAN&gt;
&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;topic.publish('query', data);&lt;/SPAN&gt;
},&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:58:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786279#M3636</guid>
      <dc:creator>CarlosNantes</dc:creator>
      <dc:date>2021-12-12T08:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: onReceiveData from the Search widget is not working.</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786280#M3637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah I just replaced it with what I pasted here. It's not in the code twice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Aug 2020 11:34:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786280#M3637</guid>
      <dc:creator>MartinOwens1</dc:creator>
      <dc:date>2020-08-14T11:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: onReceiveData from the Search widget is not working.</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786281#M3638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would think it should still fetch data since I'm calling the fetchData(); method on line 2. The results are published after both widgets are created.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Aug 2020 11:38:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786281#M3638</guid>
      <dc:creator>MartinOwens1</dc:creator>
      <dc:date>2020-08-14T11:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: onReceiveData from the Search widget is not working.</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786282#M3639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The end goal here is to send a value to the Search dijit and execute the search function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Aug 2020 11:42:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786282#M3639</guid>
      <dc:creator>MartinOwens1</dc:creator>
      <dc:date>2020-08-14T11:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: onReceiveData from the Search widget is not working.</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786283#M3640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone been able to test this and see if they can receive data in the Search widget?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2020 11:39:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786283#M3640</guid>
      <dc:creator>MartinOwens1</dc:creator>
      <dc:date>2020-08-17T11:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: onReceiveData from the Search widget is not working.</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786284#M3641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;After testing I can confirm you are correct that the Search widget is Not receiving data.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2020 12:23:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786284#M3641</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-08-17T12:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: onReceiveData from the Search widget is not working.</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786285#M3642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For anyone that encounters this issue in the future here is how to make the Search widget receive data with the OnReceiveData method:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt; postCreate&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
		&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listenWidgetIds&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;push&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Widget ID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:58:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/onreceivedata-from-the-search-widget-is-not/m-p/786285#M3642</guid>
      <dc:creator>MartinOwens1</dc:creator>
      <dc:date>2021-12-12T08:58:08Z</dc:date>
    </item>
  </channel>
</rss>

