<?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: Reference error when using SelectFeatures in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/reference-error-when-using-selectfeatures/m-p/823687#M7635</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;I add&amp;nbsp;var countyFeatureLayer;&amp;nbsp;But it can not remove the undefined error.&amp;nbsp; I do not need to define var in my Sandbox code , which runs well with no error.&lt;/P&gt;&lt;P&gt;Though the error does not impact my result, I can receive correct results. But I would like to fix the error. I wonder if you have any suggestions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My widget code (zipped) is attached in the previous message.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2018 20:47:53 GMT</pubDate>
    <dc:creator>Helenpeng</dc:creator>
    <dc:date>2018-03-16T20:47:53Z</dc:date>
    <item>
      <title>Reference error when using SelectFeatures</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/reference-error-when-using-selectfeatures/m-p/823685#M7633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My widget code runs well with the correct result. But I see the reference error in Console Window – it says countyFeatureLayer is not defined.&lt;/P&gt;&lt;P&gt;My widget is to show the query result in Attribute table. I use two queries – the first query is to check if the drawbox-polygon is inside the state boundary. The second query is to intersect with countyFeatureLayer to get the county attribute info. Reading questions in the forum, I use SelectFeatures and show the query result in attribute table.&lt;/P&gt;&lt;P&gt;I define countyFeatureLayer in postCreate. In _onDrawComplete function, I just countyFeatureLayer.selectFeatures. My code does not have the error before using SelectFeatures. &amp;nbsp;Also, I checked my reference, which is same as my sandbox code. I do not know why I get the reference error. See the screenshot.&lt;/P&gt;&lt;P&gt;I also attach my widget zip files.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 14:35:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/reference-error-when-using-selectfeatures/m-p/823685#M7633</guid>
      <dc:creator>Helenpeng</dc:creator>
      <dc:date>2018-03-15T14:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Reference error when using SelectFeatures</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/reference-error-when-using-selectfeatures/m-p/823686#M7634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Helen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I can't tell you much without seeing your code but it sounds like a scope issue where the&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;countyFeatureLayer var is not available in the scope of the function you are trying to use it in.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 15:02:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/reference-error-when-using-selectfeatures/m-p/823686#M7634</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-03-15T15:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Reference error when using SelectFeatures</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/reference-error-when-using-selectfeatures/m-p/823687#M7635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;I add&amp;nbsp;var countyFeatureLayer;&amp;nbsp;But it can not remove the undefined error.&amp;nbsp; I do not need to define var in my Sandbox code , which runs well with no error.&lt;/P&gt;&lt;P&gt;Though the error does not impact my result, I can receive correct results. But I would like to fix the error. I wonder if you have any suggestions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My widget code (zipped) is attached in the previous message.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 20:47:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/reference-error-when-using-selectfeatures/m-p/823687#M7635</guid>
      <dc:creator>Helenpeng</dc:creator>
      <dc:date>2018-03-16T20:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Reference error when using SelectFeatures</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/reference-error-when-using-selectfeatures/m-p/823688#M7636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Helen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;So on this line you are missing the "this." portion:&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"countyFeatureLayer "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; countyFeatureLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;it should be:&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"countyFeatureLayer "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;countyFeatureLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 21:05:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/reference-error-when-using-selectfeatures/m-p/823688#M7636</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-03-16T21:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Reference error when using SelectFeatures</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/reference-error-when-using-selectfeatures/m-p/823689#M7637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;Yes, this is the problem. Thank you for solving my issue. I thought it was some reference or variable problems, never check console.log.&lt;/P&gt;&lt;P&gt;I am kind of new to custom-widget. The forum is very helpful. By reading questions in the forum, I found the way to show query results in attribute table by using SelectFeatures. Much appreciated!&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2018 15:32:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/reference-error-when-using-selectfeatures/m-p/823689#M7637</guid>
      <dc:creator>Helenpeng</dc:creator>
      <dc:date>2018-03-19T15:32:54Z</dc:date>
    </item>
  </channel>
</rss>

