Select to view content in your preferred language

Fields property in FeartureSet is never assigned from a query task

569
1
02-07-2012 10:59 AM
ChristianMorin
Emerging Contributor
The Fields property of FeatureSet that was introduced in 2.3 of the API never gets assigned when a feature set is returned from a query task.

The fields information is returned from the rest endpoint (confirmed through fiddler and just by accessing the rest endpoint directly) but not assigned.

I believe this is a bug in 2.3 and 2.4. It would be nice if this got fixed for the next version.

Cheers,
Christian Morin.
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
Thank you for reporting this. I was able to reproduce with v2.4 but not in v3.0 Beta 2.

For v2.4, you can probably do the following workaround:
You can update this SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#QueryWithoutMap
  void QueryTask_ExecuteCompleted(object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs args)
  {
   var l = new ArcGISDynamicMapServiceLayer() { Url = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer" };
   l.GetDetails(5, (a, b) =>
    {
     FeatureSet featureSet = args.FeatureSet;
     featureSet.Fields = a.Fields;

     if (featureSet != null && featureSet.Features.Count > 0)
      ResultsJSON.Text = featureSet.ToJson();
     else
      MessageBox.Show("No features returned from query");
    });
  }
0 Kudos