Select to view content in your preferred language

OjectID Field Not Visible in SL Viewer

654
1
02-22-2013 02:13 PM
CoryBlack1
Deactivated User
I'm linking a map from ArcGIS.com to the ArcGIS Viewer for Silverlight.  From ArcGIS.com, I've configured a popup that uses the ObjectID field value.  However when accessing the popup from the SL Viewer, the field is not visible and therefore won't pass along the field value.  How can I enable this field in the SL Viewer?  It appears by default that any map service added to the SL Viewer disables the ObjectID field???
0 Kudos
1 Reply
FilipJung
Frequent Contributor
Hi, the following worked fine for me:

1) Make sure that OBJECTID is published in your map service
2) Edit Map.xml in your application (just for sure make a backup copy):

  • Find tag <esri:FeatureLayer> or <esri:ArcGISDynamicMapServiceLayer> tag for layer you want to change (the right one can be identified by <esriMapping:LayerExtensions.LayerName> tag

  • In case of FeatureLayer add OBJECTID into OutFields parameter: OutFields="OBJECTID,..."

  • Navigate to <esriMapping:FieldInfo> tag in your FeatureLayer or <esriMapping:LayerInformation.Fields> in <esriMapping:LayerInformation> in ArcGISDynamicMapServiceLayer and add this line (it may be eventually slightly different for you):

  • [HTML]<esriMapping:FieldInfo Name="OBJECTID" DisplayName="OBJECTID" FieldType="Integer" AliasOnServer="OBJECTID" DomainSubtypeLookup="None" />[/HTML]
  • I'm not sure about field type, but it can be also left out

3) Save the file and refresh your browser, OBJECTID is now visible in PopUp, even in Application Builder configuration
4) However I wasn't able to get OBJECTID into Attribute Table 😞 This logic is probably built in FeatureDataGrid in Viewer Application.

Hope this helps a bit.
Filip
0 Kudos