<?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: Populate combo box in widget from Map Service Table (ArcGIS Server 10) in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-combo-box-in-widget-from-map-service/m-p/619374#M13767</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;nshaukat,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Take a look at this thread for populating a combo box from a feature class field and ensuring they are unique and sorted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/13929-how-to-query-with-combobox-with-Flex"&gt;http://forums.arcgis.com/threads/13929-how-to-query-with-combobox-with-Flex&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Dec 2010 13:12:58 GMT</pubDate>
    <dc:creator>DanJensen</dc:creator>
    <dc:date>2010-12-06T13:12:58Z</dc:date>
    <item>
      <title>Populate combo box in widget from Map Service Table (ArcGIS Server 10)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-combo-box-in-widget-from-map-service/m-p/619370#M13763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm creating a new widget with a series of combo boxes. The data source for each como box is a table that is part of a map service. Is it necessary to loop through the table and add the values to the combobox? Or can I just somehow reference the table using the QueryTask. Below is a snippet of my code showing what I'm trying to do. Any help or samples would be greatly appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Barb Patteron&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;fx: Declarations&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;esri:QueryTask id="queryApps"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://arcportal-gamma/ArcGIS/rest/services/MyMapService/MapServer/1" rel="nofollow" target="_blank"&gt;http://arcportal-gamma/ArcGIS/rest/services/MyMapService/MapServer/1&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; useAMF="false"/&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;esri:Query id="query"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields="[AppScenario]"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; returnGeometry="false"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &amp;lt;/fx: Declarations&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Inside my widget template I have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;mx:VBox&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mx:Label text="App Scenario"/&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mx:ComboBox id="App" labelField="" dataProvider="{queryApps.execute(query)}"/&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/mx:VBox&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Oct 2010 16:26:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-combo-box-in-widget-from-map-service/m-p/619370#M13763</guid>
      <dc:creator>BarbaraPatterson</dc:creator>
      <dc:date>2010-10-20T16:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Populate combo box in widget from Map Service Table (ArcGIS Server 10)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-combo-box-in-widget-from-map-service/m-p/619371#M13764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don�??t believe that�??s possible. You need a �??complete�?� event handler.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could have a helper function that would fill the combo box..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sample (works)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

 private function fillComboBoxWithData(cmb:ComboBox, displayFieldName:String, featureSet:FeatureSet):void
 {
&amp;nbsp; var results:ArrayCollection = new ArrayCollection();
&amp;nbsp; for each (var graphic:Graphic in featureSet.features)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; var fieldValue:String = graphic.attributes[displayFieldName].toString(); 
&amp;nbsp;&amp;nbsp; results.addItem({label: fieldValue, data:graphic});
&amp;nbsp; }
&amp;nbsp; cmb.labelField = "label";
&amp;nbsp; cmb.dataProvider = results;
 }

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Drew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:27:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-combo-box-in-widget-from-map-service/m-p/619371#M13764</guid>
      <dc:creator>Drew</dc:creator>
      <dc:date>2021-12-12T02:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Populate combo box in widget from Map Service Table (ArcGIS Server 10)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-combo-box-in-widget-from-map-service/m-p/619372#M13765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Barbara,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think you will need to execute the query through a helper function, then it may be possible to bind the dataProvider property of the comboBox to the executeLastResult property of the query task.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Oct 2010 22:04:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-combo-box-in-widget-from-map-service/m-p/619372#M13765</guid>
      <dc:creator>DanJensen</dc:creator>
      <dc:date>2010-10-25T22:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Populate combo box in widget from Map Service Table (ArcGIS Server 10)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-combo-box-in-widget-from-map-service/m-p/619373#M13766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm creating a new widget with a series of combo boxes. The data source for each como box is a table that is part of a map service. Is it necessary to loop through the table and add the values to the combobox? Or can I just somehow reference the table using the QueryTask. Below is a snippet of my code showing what I'm trying to do. Any help or samples would be greatly appreciated!&lt;BR /&gt;&lt;BR /&gt;Thanks, Barb Patteron&lt;BR /&gt;&lt;BR /&gt;&amp;lt;fx: Declarations&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;esri:QueryTask id="queryApps"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url="http://arcportal-gamma/ArcGIS/rest/services/MyMapService/MapServer/1"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; useAMF="false"/&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;esri:Query id="query"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields="[AppScenario]"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; returnGeometry="false"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt;&lt;BR /&gt; &amp;lt;/fx: Declarations&amp;gt;&lt;BR /&gt;&lt;BR /&gt;Inside my widget template I have:&lt;BR /&gt;&amp;lt;mx:VBox&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mx:Label text="App Scenario"/&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mx:ComboBox id="App" labelField="" dataProvider="{queryApps.execute(query)}"/&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/mx:VBox&amp;gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Barbara,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I see you were looking for a solution to populate a combobox with values from a table present in a map service. I am also trying to do the same thing to populate with values in a field of a feature class in a service. I also need to create this list of unique values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you figured out how to do it. If so, please post a sample.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;nshaukat&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 00:37:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-combo-box-in-widget-from-map-service/m-p/619373#M13766</guid>
      <dc:creator>NadeemShaukat</dc:creator>
      <dc:date>2010-12-06T00:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Populate combo box in widget from Map Service Table (ArcGIS Server 10)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-combo-box-in-widget-from-map-service/m-p/619374#M13767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;nshaukat,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Take a look at this thread for populating a combo box from a feature class field and ensuring they are unique and sorted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/13929-how-to-query-with-combobox-with-Flex"&gt;http://forums.arcgis.com/threads/13929-how-to-query-with-combobox-with-Flex&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 13:12:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-combo-box-in-widget-from-map-service/m-p/619374#M13767</guid>
      <dc:creator>DanJensen</dc:creator>
      <dc:date>2010-12-06T13:12:58Z</dc:date>
    </item>
  </channel>
</rss>

