<?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: Select features sample not actually selecting features in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-features-sample-not-actually-selecting/m-p/650008#M60618</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's one of those tricky parts of JavaScript:&amp;nbsp; scope and the var keyword. Glad you got it fixed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Apr 2012 18:31:41 GMT</pubDate>
    <dc:creator>derekswingley1</dc:creator>
    <dc:date>2012-04-30T18:31:41Z</dc:date>
    <item>
      <title>Select features sample not actually selecting features</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-features-sample-not-actually-selecting/m-p/650005#M60615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using the sample here (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm&lt;/A&gt;&lt;SPAN&gt;) on my own data. I have successfully implemented it once using a feature service from ArcGIS Online (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://maps4.arcgisonline.com/ArcGIS/rest/services/World_Bank/WB_World_Bank_Projects/MapServer/3" rel="nofollow" target="_blank"&gt;http://maps4.arcgisonline.com/ArcGIS/rest/services/World_Bank/WB_World_Bank_Projects/MapServer/3&lt;/A&gt;&lt;SPAN&gt;). However, when I try to replace it with my own feature service (sorry, behind my firewall, no link) the event that is fired "onDrawEnd" does not have a reference to the relevant layer (featureLayer in block below).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I missing something? I don't know why the featureLayer reference is not working for one link when it worked for the other. Both versions show the features on the map fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;function initSelectToolbar(map) {&amp;nbsp; //This little bit is to enable drawing for item selection&amp;nbsp; selectionToolbar = new esri.toolbars.Draw(map);&amp;nbsp; var selectQuery = new esri.tasks.Query();&amp;nbsp;&amp;nbsp; dojo.connect(selectionToolbar, "onDrawEnd", function(geometry) { &amp;nbsp; selectQuery.geometry = geometry; &amp;nbsp; featureLayer.selectFeatures(selectQuery, esri.layers.FeatureLayer.SELECTION_NEW); &amp;nbsp; selectionToolbar.deactivate();&amp;nbsp; });&amp;nbsp; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2012 15:24:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-features-sample-not-actually-selecting/m-p/650005#M60615</guid>
      <dc:creator>BenStewart</dc:creator>
      <dc:date>2012-04-30T15:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Select features sample not actually selecting features</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-features-sample-not-actually-selecting/m-p/650006#M60616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In the &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/fl_selectfeatures.html" rel="nofollow" target="_blank"&gt;sample you're referring to&lt;/A&gt;&lt;SPAN&gt;, the featureLayer variable is global. Is it a global in your app?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If it is, can you post a more complete code sample?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2012 15:36:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-features-sample-not-actually-selecting/m-p/650006#M60616</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2012-04-30T15:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Select features sample not actually selecting features</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-features-sample-not-actually-selecting/m-p/650007#M60617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That's the answer, kind of. It was declared as a global variables, but I had a var before the vairable definition in the init function. Once I removed that, everything was golden.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot! I never would have remembered that&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2012 15:51:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-features-sample-not-actually-selecting/m-p/650007#M60617</guid>
      <dc:creator>BenStewart</dc:creator>
      <dc:date>2012-04-30T15:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Select features sample not actually selecting features</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-features-sample-not-actually-selecting/m-p/650008#M60618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's one of those tricky parts of JavaScript:&amp;nbsp; scope and the var keyword. Glad you got it fixed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2012 18:31:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-features-sample-not-actually-selecting/m-p/650008#M60618</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2012-04-30T18:31:41Z</dc:date>
    </item>
  </channel>
</rss>

