<?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 Web AppBuilder Custom Widget - Use setTimeout() with publishData() in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-custom-widget-use-settimeout-with/m-p/455658#M42108</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The publishData() function won't work inside setTimeout() in my custom widget - returns error: this.publishData() is not a function. But this.publishData() works fine&amp;nbsp;alone. How to get this.publishData() work inside setTimeout()?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Jan 2020 14:52:24 GMT</pubDate>
    <dc:creator>XuanKuai</dc:creator>
    <dc:date>2020-01-30T14:52:24Z</dc:date>
    <item>
      <title>Web AppBuilder Custom Widget - Use setTimeout() with publishData()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-custom-widget-use-settimeout-with/m-p/455658#M42108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The publishData() function won't work inside setTimeout() in my custom widget - returns error: this.publishData() is not a function. But this.publishData() works fine&amp;nbsp;alone. How to get this.publishData() work inside setTimeout()?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 14:52:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-custom-widget-use-settimeout-with/m-p/455658#M42108</guid>
      <dc:creator>XuanKuai</dc:creator>
      <dc:date>2020-01-30T14:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Web AppBuilder Custom Widget - Use setTimeout() with publishData()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-custom-widget-use-settimeout-with/m-p/455659#M42109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Xuan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Your issue is going to be a scope issue. The "this" object inside your setTimeout function is not scoped to the widget so this.publishData is not a function. You need to hitch your setTimeout function using lang.hitch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;setTimeout&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lang&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hitch&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="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;publishData&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;yourdata&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="number token"&gt;200&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:18:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-custom-widget-use-settimeout-with/m-p/455659#M42109</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T20:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Web AppBuilder Custom Widget - Use setTimeout() with publishData()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-custom-widget-use-settimeout-with/m-p/455660#M42110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sharp answer, thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 16:18:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-custom-widget-use-settimeout-with/m-p/455660#M42110</guid>
      <dc:creator>XuanKuai</dc:creator>
      <dc:date>2020-01-30T16:18:20Z</dc:date>
    </item>
  </channel>
</rss>

