<?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 How to use queryTask callback function in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-querytask-callback-function/m-p/100703#M9256</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I use queryTask to call a function, say, function showResults() as below:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;queryTask.execute(query, showResults);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;function showResults (results) { ….}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One thing I am confused is that: usually when a function is called, the parameter that the&amp;nbsp;function is going to use (e.g., results in this case) should be included inside the showResults().&amp;nbsp; Since queryTask called this function, it should be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;queryTask.execute(query, showResults(&lt;STRONG&gt;ABC&lt;/STRONG&gt;); then this &lt;STRONG&gt;ABC&lt;/STRONG&gt; will be passed into function showResults.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above example, there is nothing like showResults(&lt;STRONG&gt;ABC&lt;/STRONG&gt;), just showResults.&amp;nbsp; How can the function showResults (results) tell what kind of parameter is actually passed into it? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Sep 2016 20:18:11 GMT</pubDate>
    <dc:creator>LeiZhou1</dc:creator>
    <dc:date>2016-09-27T20:18:11Z</dc:date>
    <item>
      <title>How to use queryTask callback function</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-querytask-callback-function/m-p/100703#M9256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I use queryTask to call a function, say, function showResults() as below:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;queryTask.execute(query, showResults);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;function showResults (results) { ….}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One thing I am confused is that: usually when a function is called, the parameter that the&amp;nbsp;function is going to use (e.g., results in this case) should be included inside the showResults().&amp;nbsp; Since queryTask called this function, it should be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;queryTask.execute(query, showResults(&lt;STRONG&gt;ABC&lt;/STRONG&gt;); then this &lt;STRONG&gt;ABC&lt;/STRONG&gt; will be passed into function showResults.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above example, there is nothing like showResults(&lt;STRONG&gt;ABC&lt;/STRONG&gt;), just showResults.&amp;nbsp; How can the function showResults (results) tell what kind of parameter is actually passed into it? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2016 20:18:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-querytask-callback-function/m-p/100703#M9256</guid>
      <dc:creator>LeiZhou1</dc:creator>
      <dc:date>2016-09-27T20:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to use queryTask callback function</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-querytask-callback-function/m-p/100704#M9257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lei,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;That is because the result of a queryTask is a deferred/promise. The results are added to the resulting function based on the deferred being resolved. You may want to learn more about dojos deferred and promise classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://dojotoolkit.org/documentation/tutorials/1.10/promises/" title="https://dojotoolkit.org/documentation/tutorials/1.10/promises/"&gt;https://dojotoolkit.org/documentation/tutorials/1.10/promises/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2016 20:47:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-querytask-callback-function/m-p/100704#M9257</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-09-27T20:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to use queryTask callback function</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-querytask-callback-function/m-p/100705#M9258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2016 19:04:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-querytask-callback-function/m-p/100705#M9258</guid>
      <dc:creator>LeiZhou1</dc:creator>
      <dc:date>2016-09-29T19:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to use queryTask callback function</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-querytask-callback-function/m-p/100706#M9259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lei,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Glad to help. Don't forget to mark this question as answered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2016 19:06:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-querytask-callback-function/m-p/100706#M9259</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-09-29T19:06:34Z</dc:date>
    </item>
  </channel>
</rss>

