Select to view content in your preferred language

Template Picker and Multiple Domain Values 2.3 and 10 SP3

663
4
12-16-2011 09:55 AM
HyrumErnstrom
Regular Contributor
Will the Template Picker work with a layer that has multiple coded domain values?
0 Kudos
4 Replies
JenniferNery
Esri Regular Contributor
I'm not sure I understand the question. The following service has multiple coded-value domain as well and is supported in TemplatePicker: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer.... TemplatePicker use Prototype Attributes in determining default values for fields based on feature type. If you try this feature service and set TemplatePicker.ShowAttributesOnAdd=True, you will see these attributes applied. Are you finding issues with your data?
0 Kudos
HyrumErnstrom
Regular Contributor
I tested that and it worked. It appears that server is 10.0.

If I use our dev machine http://ags.itnexus.com/ArcGIS/rest/services/Edit/Editing/FeatureServer/0 on 10.03

I get a ValidationException error "Field value does not match acceptable coded value domain codes."

Our other developer said this worked before the move to SP3.
0 Kudos
JenniferNery
Esri Regular Contributor
You can set FeatureLayer.ValidateEdits=False or fix your service.

Your service defines the field as such:
{
"name" : "IrrigationType",
"type" : "esriFieldTypeString",
"alias" : "IrrigationType",
"editable" : true,
"length" : 2,
"domain" :
{
"type" : "codedValue",
"name" : "TreeIrrigationType",
"codedValues" : [
{
"name" : "Drip Irrigation",
"code" : "DI"
},
{
"name" : "Gator Bags",
"code" : "GB"
},
{
"name" : "Irrigation System",
"code" : "IS"
},
{
"name" : "Non-Irrigated",
"code" : "NI"
}
]
}
},

with the following Prototype attribute:
"prototype" : {
"attributes" : {
"IrrigationType" : " ",
"TreeType" : "GRA",
"TreeCondition" : null,
"TreeValue" : 0,
"TreeSize" : null,
"DatePlanted" : null
}

Validation check in the client fails because space is not one of the expected coded-value domain, so you might want to change the default value in your prototype attribute.
0 Kudos
HyrumErnstrom
Regular Contributor
Will do, thank you.
0 Kudos