<?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: JSAPI - Getting &amp;quot;Type Error a.toLowerCase is not a function&amp;quot; with Search  in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/jsapi-getting-quot-type-error-a-tolowercase-is-not/m-p/855458#M11341</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Been racking my brains here (bruisin' em). Am I missing the obvious?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've come across two BUGS that don't sound exactly like&amp;nbsp;have what's going on here by have given me reason to tweak my solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First one - &lt;A class="link-titled" href="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDA5NTgxMA==" title="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDA5NTgxMA=="&gt;BUG-000095810: The Search widget returns a "no results found" messa..&lt;/A&gt;&amp;nbsp; Search widget does not work&amp;nbsp;against fields using coded value domains. Sure enough the Feature Layer I'm searching had domains although not the field that is my display and search field. So I replaced&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second one - &lt;A href="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEyMTQ4Mg==" title="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEyMTQ4Mg=="&gt;BUG-000121482: The Search widget in Web AppBuilder for ArcGIS fails..&lt;/A&gt;&amp;nbsp;. Search widget apparently doesn't work with SQL database views. I had recently set this up with a view to avoid the join someone else's had set up in the map project, which in turn prevented pagination. So I tried&amp;nbsp;various values for maxSuggestions and finally replaced the view with a completely new table without domain and republished using Pro 2.5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a brand new app in WAB to rule out that I've contaminated any of the OTB files. I've tried to go through the actual API code for &lt;A href="https://js.arcgis.com/3.32/init.js"&gt;inits.js&lt;/A&gt; and &lt;A href="https://js.arcgis.com/3.32/esri/dijit/Search.js"&gt;Search.js&lt;/A&gt;. But it's impossible to decipher the minified code. My gut tells there is some communication breakdown between the widget and the map service. But I don't know how to further test. Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Aug 2020 17:30:45 GMT</pubDate>
    <dc:creator>Arne_Gelfert</dc:creator>
    <dc:date>2020-08-31T17:30:45Z</dc:date>
    <item>
      <title>JSAPI - Getting "Type Error a.toLowerCase is not a function" with Search</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/jsapi-getting-quot-type-error-a-tolowercase-is-not/m-p/855457#M11340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So there is nothing worse, I find, than&amp;nbsp;wanting to reuse some code you have successfully deployed in once place and not getting it work elsewhere. I'm running into this with&amp;nbsp;using&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/3/jsapi/search-amd.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Search&amp;nbsp;(&lt;/A&gt;JSAPI 3,x) in my latest custom widget for WAB 2.16.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a simple search with suggestions that I'm recycling.&amp;nbsp;Gave it a new name and hooked it into a new service but it bombs&amp;nbsp;when trying to return suggestions. This is what I'm doing, maybe someone spots my obvious mistake.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;// plugged in the widget.html, I have

&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;div&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;data-dojo-attach-point&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;searchWithSuggestions&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;id&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;searchWithSuggestions&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;div&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&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;P&gt;Then I do this in&amp;nbsp;Javascript...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// widget.js&lt;/SPAN&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="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="keyword token"&gt;var&lt;/SPAN&gt; searchUrl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"https://.....Mapserver/1 "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; searchSources &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;
        &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;featureLayer&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;FeatureLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;searchUrl&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
         name&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Layer 1'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
         outFields&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
         displayField&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"NAME"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
         searchFields&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"NAME"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
         suggestionTemplate&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"${NAME}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
         enableSearchingAll&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
         enableSuggestions&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
         exactMatch&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
         minCharacters&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&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;searchWithSuggestions &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Search&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        sources&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; searchSources&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
        popupEnabled&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
        autoSelect&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
        enableSourcesMenu&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
        enableSuggestions&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
        maxSuggestions&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
        allPlaceholder&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"enter your search here"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
        autoNavigate&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"searchWithSuggestions"&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;searchWithSuggestions&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;startup&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="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;/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;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;/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;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;P&gt;&lt;/P&gt;&lt;P&gt;Search widget shows up in widget. But when i start typing and get past 3 characters (minCharacters), it fails with&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/504776_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;So something clearly is not right with the suggestions. I've checked the map service and it supports pagination. Something wrong with my code, something else I need to check ?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:34:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/jsapi-getting-quot-type-error-a-tolowercase-is-not/m-p/855457#M11340</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2021-12-12T10:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: JSAPI - Getting "Type Error a.toLowerCase is not a function" with Search</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/jsapi-getting-quot-type-error-a-tolowercase-is-not/m-p/855458#M11341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Been racking my brains here (bruisin' em). Am I missing the obvious?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've come across two BUGS that don't sound exactly like&amp;nbsp;have what's going on here by have given me reason to tweak my solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First one - &lt;A class="link-titled" href="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDA5NTgxMA==" title="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDA5NTgxMA=="&gt;BUG-000095810: The Search widget returns a "no results found" messa..&lt;/A&gt;&amp;nbsp; Search widget does not work&amp;nbsp;against fields using coded value domains. Sure enough the Feature Layer I'm searching had domains although not the field that is my display and search field. So I replaced&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second one - &lt;A href="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEyMTQ4Mg==" title="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEyMTQ4Mg=="&gt;BUG-000121482: The Search widget in Web AppBuilder for ArcGIS fails..&lt;/A&gt;&amp;nbsp;. Search widget apparently doesn't work with SQL database views. I had recently set this up with a view to avoid the join someone else's had set up in the map project, which in turn prevented pagination. So I tried&amp;nbsp;various values for maxSuggestions and finally replaced the view with a completely new table without domain and republished using Pro 2.5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a brand new app in WAB to rule out that I've contaminated any of the OTB files. I've tried to go through the actual API code for &lt;A href="https://js.arcgis.com/3.32/init.js"&gt;inits.js&lt;/A&gt; and &lt;A href="https://js.arcgis.com/3.32/esri/dijit/Search.js"&gt;Search.js&lt;/A&gt;. But it's impossible to decipher the minified code. My gut tells there is some communication breakdown between the widget and the map service. But I don't know how to further test. Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2020 17:30:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/jsapi-getting-quot-type-error-a-tolowercase-is-not/m-p/855458#M11341</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2020-08-31T17:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: JSAPI - Getting "Type Error a.toLowerCase is not a function" with Search</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/jsapi-getting-quot-type-error-a-tolowercase-is-not/m-p/855459#M11342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rebuilding from scratch a 3rd of 4th time, finally did the trick. Oh how I wish that error messages were a little more helpful when working with the JSAPI.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Sep 2020 15:47:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/jsapi-getting-quot-type-error-a-tolowercase-is-not/m-p/855459#M11342</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2020-09-17T15:47:37Z</dc:date>
    </item>
  </channel>
</rss>

