title: TypeError: this._url is undefined at Dojo FilteringSelect onChange callback
body: <p>I keep getting following error: <code>TypeError: this._url is undefined</code> at the callback of a Dojo FilteringSelect.</p>
  
  <p>I simplified my code to this:</p>
  
  <pre><code>var testFeatures = [
  {   "id": 1, "Adresa": "Pyšvejcova 6, Kotěhůlky"},
  ...
  ];
  
  var filteringSelect = new FilteringSelect({
      id: "testSelect",
      autoComplete: false,
      searchAttr: "Adresa",
      store: new Memory({ data: testFeatures }),
      onChange: this.onSelected
  }, "testSelect");
  filteringSelect.startup();
  
  //end of the function, still in the same define callback
  
  onSelected: function () {
      //custom processing
      var queryTask = new esri.tasks.QueryTask(this.serviceUrl);
      var query = new esri.tasks.Query();
      query.outFields = ["OBJECTID"];
      query.where = "Adresa=" + dojo.byId("testSelect").value;
      query.returnGeometry = true;
      queryTask.execute(query, this.zoomToSelected);
  }
  
  zoomToSelected: function (featureSet) {
      //custom map processing
  }
  </code></pre>
  
  <p>and HTML:</p>
  
  <pre><code>&lt;input id="testSelect" data-dojo-attach-point="testSelect" /&gt;
  </code></pre>
  
  <p>I have no idea where's the problem, Google found no case similar to mine. FireBug says the error occurs in init.js. Console says line 199, but the code in question (<code>...nction(){},onExecuteForCountComplete:function(){},onExecuteForExtentComplete:fun...</code>) is on line 256.</p>
  
  <p>One possible cause of problems might be ArcGIS JavaScript API or Web AppBuilder - this seems not to be one of the "ArcGIS-heavy" parts of the code, but I don't know for sure. It's ArcGIS JS API 3.15 (Dojo 1.10) and Web AppBuilder for developers version 1.4.</p>
  
  <p>EDIT: with help of @KenFranqueiro and <a href="https://stackoverflow.com/a/19611567/1801588">this post</a> I made some progress. I can't say that I fully understand the <code>onChange</code> callbacks, but I learnt to omit the parentheses while calling a named function. The <code>onSelected</code> still wasn't called, but modifying the input data to include <code>id</code> solved this. But it didn't solve the main problem...</p>
  
  <p>Now the old good <code>TypeError: this._url is undefined</code> occurs at <code>queryTask.execute</code>, or between it and start of <code>zoomToSelected</code> method. The exact place where the error occurs changed to line 256, column 351, with following referenced code:</p>
  
  <pre><code>...e:function(a,b,c,d,f){var m=f.assembly;a=this._encode(n.mixin({},this._url.query...
  </code></pre>
  
  <p>There is a pointer at the = after "a", so the error seems to be to the right of it, trying to mixin something non-existent to something else. I have no idea what the <code>this</code> in the <code>init.js</code> should mean. Unfortunately, dojo core code is almost undebuggable without some de-obfuscation. Is this my only option, or does anybody know how to solve it?</p>
  
  <p>So debugging the <code>init.js</code> wasn't so hard, it takes <code>QueryTask</code> as <code>this</code>. As far as I know, this shouldn't have a <code>_url</code> attribute. So I must have some mistake in the <code>queryTask</code> as well.</p>
  
  <p><em>Obsolete part of the question, archived:</em></p>
  
  <p>I wonder whether the problem might be caused by the <code>onChange</code> callback's argument, which I don't really understand. I've read several examples of Dojo FilteringSelect with onChange event set, like <a href="https://dojotoolkit.org/reference-guide/1.10/dijit/form/FilteringSelect.html#codependent-filteringselect-combobox-widgets" rel="nofollow noreferrer">the official one</a>. Usually it has some argument, but I don't know what does it mean and where it gets from. In the official example it corresponds to the <code>div id</code> and nothing else. However, how is the <code>id</code> translated to a variable and even whether my assumption that it's the <code>id</code> is correct. The <a href="https://dojotoolkit.org/api/#1_10dijit_form_FilteringSelect_onChange" rel="nofollow noreferrer">detailed documentation</a> is not much helpful in this case.</p>
  
  <p><em>Older EDIT:</em> <code>testSelect</code> is an object. Seems it was created implicitly with the <code>dom</code> - it's a childnode of <code>this.domNode</code>. So now I understand where it comes from, but not how to prepare another function to be called on change and why the correct syntax is what it is.</p>
  
  <p>Also, I don't know where exactly is the problematic undefined <code>this._url</code> supposed to exist. In my example, <code>this</code> refers to the dijit, but I have no idea what is the scope of the part of <code>init.js</code> where the problem occurs.</p>
  
  <p>I'm not sure how much related are the two subquestions (confusion in the <code>onChange</code> callback and identification of this in <code>init.js</code>), I only suppose they are symptoms of the same issue since the error is thrown at the onChange event in my code.</p>