Select to view content in your preferred language

Apply button in Attributes table disables

1436
6
09-23-2011 07:13 PM
JudyTroutwine
Regular Contributor
I notice that the interactive editing samples

( one example is of course http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitEditorWidget)

present only one attribute for value entry. 

In a simple project here having one dynamic background layer and one point feature layer, there are about 20 attributes for the point feature layer.  A few of the attributes have domain lists.  There is a unique identifier and various text and numeric fields.  Whenever I use the Attribute table in EditorWidget (on adding a feature, or when first clicking the icon for the attributes and then a feature) or with the FeatureDataForm, the "Apply" button goes gray after typing a value for one field.  The field data type, or whether there is a domain list seems to make no difference.  I seems to be that only one attribute can be entered before "Apply" is disabled.
0 Kudos
6 Replies
JenniferNery
Esri Regular Contributor
I understand this is an older post but if you are still looking for answers, this might be a related thread: http://forums.arcgis.com/threads/33290-Silverlight-API-2.2-Not-Detecting-changes-in-FeatureDataForm. EditorWidget AttributeWindow also use FeatureDataForm. This bug fix will be available in our next release.
0 Kudos
JudyTroutwine
Regular Contributor
Thank you much for the response.  I had given up on hoping for an answer and then saw yours just recently.  The suggested thread that mentions avoiding any null values in records was helpful.  By adding default "unknown" or 0 for example to avoid null values solves the problem for FeatureDataForm (used alone or when editing attributes with the EditorWidget).  However,  adding attribute values for new features with the EditorWidget still has the graying out problem.  Also, added features are not saved when using the EditorWidget or the Editor.  (I can though delete features when using the EditorWidget.)  Perhaps there is another work around that will help when using the EditorWidget.
0 Kudos
JudyTroutwine
Regular Contributor
I am now able to also save new point features with the Editor and EditWidget.  That had to do with the GIS server option to supply a default z value when a z value attribute is present.

The Apply button still disables after adding only one attribute value for a new point feature in the EditWidget.  Also, if I do press Apply with just one attribute value filled in that value is not saved.

The solution may be along the lines as mentioned in preceding messages about not having any null values before opening the attribute table.  A new feature of course has no attribute values until they are filled in.  I would like to assign default values when the point is added.  How is that best to be approached?
0 Kudos
JudyTroutwine
Regular Contributor
I was able to set default attribute values in the code behind.  The attributes form now functions correctly.
0 Kudos
CodyMarshall
New Contributor
Can you please explain in a little more detail how you resolved this issue, I am running into the same problem.
0 Kudos
JudyTroutwine
Regular Contributor
Here is the basic idea:

   private void editorForWidget_EditCompleted(object sender, Editor.EditEventArgs e)
        {
     
       ....           
         
                     if (e.Action == Editor.EditAction.Add)
                     {
                          foreach (Editor.Change change in e.Edits)
                          {
                              if (change.Layer != null && change.Layer is FeatureLayer && change.Graphic != null)
                              {
                                 
                               Graphic feat = change.Graphic;
                  
                                feat.Attributes["UniqueID"] = maxID + 1;
                                feat.Attributes["POINT_XCoord"] = Math.Round(feat.Geometry.Extent.GetCenter().X,2);
                                feat.Attributes["POINT_YCoord"] = Math.Round(feat.Geometry.Extent.GetCenter().Y,2);
                                feat.Attributtes["Name"] = "unknown";
                                   ...
                 
                                FeatureLayer featureLayer = change.Layer as FeatureLayer;
                                FDForm.ApplyChanges();                                       //form in xaml page
                                ShowAttributeForm(featureLayer, feat);
                                maxID = maxID + 1;
                                break;
                                }
                             }
                        }
          }
0 Kudos