I am going through this tutorial and I keep getting this error:
Tutorial: Create a ListView widget—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers
Attached is the code.
Settings.js:
I do not have a config.js in my settings folder. There wasn't a step for that in the tutorial.
What do the config.js file and the Settings.js file in the settings folder look like? Does they contain an entry for layerId? This is mentioned in the section "Customize the Settings page". This is how this.config gets variables assigned.
Hello Ken,
Thanks for the response.
What do you mean by that? I went through all the steps.
Was that one of them?
The first error points to line 47
layer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">queryFeatures</SPAN><SPAN class="punctuation token">(</SPAN>query<SPAN class="punctuation token">,</SPAN> lang<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hitch</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">function</SPAN><SPAN class="punctuation token">(</SPAN>featureSet<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
which means that "layer" is undefined. You get that earlier at line 39
<SPAN class="keyword token">var</SPAN> layer <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">getLayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>config<SPAN class="punctuation token">.</SPAN>layerId<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
Have you set the layerId property in the config to a valid layer in the map?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.