<?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: add a button click event in _showResult() in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/add-a-button-click-event-in-showresult/m-p/344294#M9167</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Robert. so if understood it correctly, my way will fire this.map.centerAndZoom() automatically without clicking while your version assigns a function to the click event and fire only when user clicks the button, correct? Thanks so much for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 May 2016 13:18:32 GMT</pubDate>
    <dc:creator>Alexwang</dc:creator>
    <dc:date>2016-05-24T13:18:32Z</dc:date>
    <item>
      <title>add a button click event in _showResult()</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/add-a-button-click-event-in-showresult/m-p/344292#M9165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI, very confused about this dojo API and widget stuff. I want to add a button click event in the QueryTask _showResults() function so zooming to a feature is triggered ONLY when a button gets clicked. The following codes automatically trigger the button click event after the query finishes which is not what i want. Please help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_query: function(){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; var query = new Query();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; query.where = "1=1";&lt;/P&gt;&lt;P&gt;&amp;nbsp; query.outFields = ["ID", "Name"];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; query.returnGeometry = true;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; var queryTask = new QueryTask("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2F" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt;......");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; queryTask.execute(query, lang.hitch(this, this._showResults));&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;_showResults: function(featureSet){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.own(on(this.btnZoomTo, "click", lang.hitch(this, this.map.centerAndZoom(featureSet.features[0].geometry, 10))));&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 17:50:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/add-a-button-click-event-in-showresult/m-p/344292#M9165</guid>
      <dc:creator>Alexwang</dc:creator>
      <dc:date>2016-05-23T17:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: add a button click event in _showResult()</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/add-a-button-click-event-in-showresult/m-p/344293#M9166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The issue is that you are not assigning a function to the click, you were just assigning code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;_showResults: function(featureSet){
&amp;nbsp;&amp;nbsp;&amp;nbsp; this.own(on(this.btnZoomTo, "click", lang.hitch(this, function{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.map.centerAndZoom(featureSet.features[0].geometry, 10)
&amp;nbsp;&amp;nbsp;&amp;nbsp; })));
},&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:13:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/add-a-button-click-event-in-showresult/m-p/344293#M9166</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T16:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: add a button click event in _showResult()</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/add-a-button-click-event-in-showresult/m-p/344294#M9167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Robert. so if understood it correctly, my way will fire this.map.centerAndZoom() automatically without clicking while your version assigns a function to the click event and fire only when user clicks the button, correct? Thanks so much for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 13:18:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/add-a-button-click-event-in-showresult/m-p/344294#M9167</guid>
      <dc:creator>Alexwang</dc:creator>
      <dc:date>2016-05-24T13:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: add a button click event in _showResult()</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/add-a-button-click-event-in-showresult/m-p/344295#M9168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; That is correct.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 13:27:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/add-a-button-click-event-in-showresult/m-p/344295#M9168</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-05-24T13:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: add a button click event in _showResult()</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/add-a-button-click-event-in-showresult/m-p/344296#M9169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is my first WAB and widget project. lots of stuff to learn. thanks so much for your help. you made my life easier! t&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 13:34:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/add-a-button-click-event-in-showresult/m-p/344296#M9169</guid>
      <dc:creator>Alexwang</dc:creator>
      <dc:date>2016-05-24T13:34:06Z</dc:date>
    </item>
  </channel>
</rss>

