<?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: trouble populating a combo box with feature values in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trouble-populating-a-combo-box-with-feature-values/m-p/153757#M14346</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
dijit.byId("cboTipList").set("store", store);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To specify your store for your dijit. This was a Dojo-related change that happened when we moved from 1.6 to 1.7 (this happened at JS API version 3.0).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 08:13:20 GMT</pubDate>
    <dc:creator>derekswingley1</dc:creator>
    <dc:date>2021-12-11T08:13:20Z</dc:date>
    <item>
      <title>trouble populating a combo box with feature values</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trouble-populating-a-combo-box-with-feature-values/m-p/153756#M14345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In a web map I'm developing, I want a combo box populated with project names and FID so that once the user selects a project, I can zoom to that project's feature extent. Within my Init() function, I'm using a query task like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; //Push the attributes of the TIP Projects into the combo box
 var query = new esri.tasks.Query();&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 query.where = "1=1";
 query.outFields = ["*"];
 
 var queryTask = new esri.tasks.QueryTask("my feature layer URL");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(query,populateCbo);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Later down the line, my function "populateCbo" attempts to populate the combo box:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;function populateCbo(results) {
 //Populate the dropdown list box with unique values
 var values = [];

 var features = results.features;
 dojo.forEach (features, function(feature) {
&amp;nbsp; curProject = feature.attributes.PROJECT;
&amp;nbsp; curFid = feature.attributes.FID;

&amp;nbsp; values.push({'project':curProject,'fid':curFid});
 });
 
 //Sort the values list by project name
 //values.sort(by('project'));
 
 var dataItems = {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifier: 'fid',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label: 'project',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; items: values
 };
 var store = new dojo.data.ItemFileReadStore({data:dataItems});
 dijit.byId("cboTipList").store = store;
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Everything seems to work just fine until the line which populates the store variable. The dataItems variable has information in it but after stepping through the "store = .." line, the data property for store is still null.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I not formatting the contents of dataItems properly? I'm not sure why it's not getting populated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 14:11:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trouble-populating-a-combo-box-with-feature-values/m-p/153756#M14345</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2012-09-24T14:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: trouble populating a combo box with feature values</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trouble-populating-a-combo-box-with-feature-values/m-p/153757#M14346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
dijit.byId("cboTipList").set("store", store);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To specify your store for your dijit. This was a Dojo-related change that happened when we moved from 1.6 to 1.7 (this happened at JS API version 3.0).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:13:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trouble-populating-a-combo-box-with-feature-values/m-p/153757#M14346</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2021-12-11T08:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: trouble populating a combo box with feature values</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trouble-populating-a-combo-box-with-feature-values/m-p/153758#M14347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Derek,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried that line as well with no luck. I should have mentioned that I'm specifying v2.8 of the API since I'm doing the initial development locally and not on a server. This hasn't been a problem with a dojo datagrid so I assumed it wouldn't be a problem with the combo box..&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 14:35:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trouble-populating-a-combo-box-with-feature-values/m-p/153758#M14347</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2012-09-24T14:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: trouble populating a combo box with feature values</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trouble-populating-a-combo-box-with-feature-values/m-p/153759#M14348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure then...can you post a repro case?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 14:55:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trouble-populating-a-combo-box-with-feature-values/m-p/153759#M14348</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2012-09-24T14:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: trouble populating a combo box with feature values</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trouble-populating-a-combo-box-with-feature-values/m-p/153760#M14349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Derek,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, the feature layers being used in my map are services on our developmental server so any full code post wouldn't work for you. The good news is that I have got it working. The short story is that I believe the javascript code was fine and I was just missing a parameter on the HTML side of things.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I changed my design from a dojo combo box to a dojo FilteringSelect. After making the change, it still didn't work. After some head scratching, I modified my HTML Input tag to read &lt;/SPAN&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;lt;input id="cboTipList" dojoType="dijit.form.FilteringSelect" searchAttr="PROJNAME" name="WidgetName" pageSize="12" placeHolder="Select A TIP Project" onChange="zoomRow(dijit.byId('cboTipList').value);"&amp;gt;&lt;/PRE&gt;&lt;SPAN&gt; and it *finally* worked. The key seems to be the "searchAttr" option, which I was originally missing. Whew!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 20:26:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trouble-populating-a-combo-box-with-feature-values/m-p/153760#M14349</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2012-09-24T20:26:45Z</dc:date>
    </item>
  </channel>
</rss>

