<?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: Search widget: how to disconnect default click handlers in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668208#M62401</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for this Kelly!&lt;/P&gt;&lt;P&gt;Using autoSelect = false DID prevent both the enter key and the "submit button" click event from selecting and zooming to the first match in the list.&amp;nbsp; Halfway there!&amp;nbsp; The enter key and submit button click DO still call the server to return results, but at least they don't automatically act on the first result now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did then need to add an event listener on the "search-results" event (which is still called by both the enter key and the "submit button" click, as well as being called by clicking on a result in the "suggestion results list").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The WAB Search widget event listener setup looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;this.own(on(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;.searchDijit, &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;'search-results'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;, lang.hitch(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;"showSearchResults"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the event handler (showSearchResults), I had to do some handling of different geometry types (for selecting, rendering and zooming) and whether there were a single match or multiple matches in multiple "source" objects.&amp;nbsp; I haven't yet made a popup dialog to show the results of multiple results in the "search-results" object, but I'm part way there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Dec 2015 22:12:27 GMT</pubDate>
    <dc:creator>AndrewMurdoch</dc:creator>
    <dc:date>2015-12-31T22:12:27Z</dc:date>
    <item>
      <title>Search widget: how to disconnect default click handlers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668201#M62394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using WAB Dev edition 1.2 and JSAPI 3.14. &lt;/P&gt;&lt;P&gt;I think this question is core to JSAPI 3.14 and Dojo, though, so I am not posting direct to a WAB forum...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been using the Search dijit/widget and I'm now trying to alter the UI/UX so that when the user clicks on the "submitNode" (the magnifiying glass icon to the right of the search box), the user is NOT taken to the "first" search result.&amp;nbsp; For now, I simply want to completely disable that button / node.&amp;nbsp; Ultimately, I will reconnect a click handler to do something custom (open a window showing a complete, comprehensive list of all search results that match the current search criteria).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ALSO want to disable the "enter" key action on the search text box (in a similar fashion) so that the user is NOT taken to the "first" search result.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I AM using the suggest function to present a dropdown list of the top results as the user types in a partial search criteria string, and I DO let the user click on a suggest result in that list to zoom to the desired result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I disable the "click" handlers for the default functionality of the Search widget?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any guidance is greatly appreciated!&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 16:04:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668201#M62394</guid>
      <dc:creator>AndrewMurdoch</dc:creator>
      <dc:date>2015-12-22T16:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget: how to disconnect default click handlers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668202#M62395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think this is possible thru the ArcGIS Javascript API as these type of functionalities are not exposed and documented in the documentation, &lt;A href="https://developers.arcgis.com/javascript/jsapi/search-amd.html" title="https://developers.arcgis.com/javascript/jsapi/search-amd.html"&gt;Search | API Reference | ArcGIS API for JavaScript&amp;nbsp; &lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2015 23:48:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668202#M62395</guid>
      <dc:creator>ErwinSoekianto</dc:creator>
      <dc:date>2015-12-29T23:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget: how to disconnect default click handlers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668203#M62396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I agree with Erwin. I spent some time trying to hack this and using aspect before, etc I was not able to disconnect the default handler. Probably if I spend more time I could, but I did not figure it out when I was working this question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2015 01:04:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668203#M62396</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-12-30T01:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget: how to disconnect default click handlers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668204#M62397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is what I was afraid of. &lt;/P&gt;&lt;P&gt;I'm thinking that to get where I want to go with the interface, I will need to create a new widget interface that leverages an instance of the JSAPI Search (and the "search()" method) behind the scenes (not placed in a DOM node).&amp;nbsp; This would allow me to use the multiple sources functions in the Search API, which we are using quite a bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This could be quite a project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your input!&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2015 14:44:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668204#M62397</guid>
      <dc:creator>AndrewMurdoch</dc:creator>
      <dc:date>2015-12-30T14:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget: how to disconnect default click handlers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668205#M62398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does it sound like it might be possible to create a new widget interface calling a "headless" JSAPI Search dijit (not applied to a DOM node) using the documented "search()" method?&amp;nbsp; Not really looking forward to that, but I'm sure I'll learn something new!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your feedback!&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2015 14:48:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668205#M62398</guid>
      <dc:creator>AndrewMurdoch</dc:creator>
      <dc:date>2015-12-30T14:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget: how to disconnect default click handlers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668206#M62399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I would say that is sounds like a sound plan that is possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2015 14:51:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668206#M62399</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-12-30T14:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget: how to disconnect default click handlers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668207#M62400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I may&amp;nbsp; not be reading the question correctly but perhaps setting autoSelect and autoNavigate to false when you create the widget will get you what you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could then setup a click handler on the search button to do something else. Here's an example:&lt;/P&gt;&lt;P&gt;&lt;/P&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; var searchWidget = new Search({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map: map,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; autoSelect: false,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; autoNavigate: false
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, "search");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; searchWidget.startup();
&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; query(".searchBtn.searchSubmit").on("click", function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("Search button clicked with value of " + searchWidget.value);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:14:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668207#M62400</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2021-12-12T04:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget: how to disconnect default click handlers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668208#M62401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for this Kelly!&lt;/P&gt;&lt;P&gt;Using autoSelect = false DID prevent both the enter key and the "submit button" click event from selecting and zooming to the first match in the list.&amp;nbsp; Halfway there!&amp;nbsp; The enter key and submit button click DO still call the server to return results, but at least they don't automatically act on the first result now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did then need to add an event listener on the "search-results" event (which is still called by both the enter key and the "submit button" click, as well as being called by clicking on a result in the "suggestion results list").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The WAB Search widget event listener setup looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;this.own(on(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;.searchDijit, &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;'search-results'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;, lang.hitch(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;"showSearchResults"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the event handler (showSearchResults), I had to do some handling of different geometry types (for selecting, rendering and zooming) and whether there were a single match or multiple matches in multiple "source" objects.&amp;nbsp; I haven't yet made a popup dialog to show the results of multiple results in the "search-results" object, but I'm part way there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2015 22:12:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668208#M62401</guid>
      <dc:creator>AndrewMurdoch</dc:creator>
      <dc:date>2015-12-31T22:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget: how to disconnect default click handlers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668209#M62402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was wondering if any of you have found a way to prevent the Search widget from automatically performing a search when a suggested value is selected?&lt;/P&gt;&lt;P&gt;Not having a database supporting pagination is messing me up, and I have to create locators from my layers to use the suggestion functionality, but I need to perform the search on the feature layers and actually return polygons instead of the point that locators return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see that I can hop in after the search is performed and results are returned, and do what I need to do, but that's kind of chatty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Feb 2016 19:08:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-how-to-disconnect-default-click/m-p/668209#M62402</guid>
      <dc:creator>DarinaTchountcheva</dc:creator>
      <dc:date>2016-02-29T19:08:37Z</dc:date>
    </item>
  </channel>
</rss>

