Select to view content in your preferred language

Edit Feature Layer Troubles

2913
13
09-05-2012 11:32 AM
BrandonVan_Horn
Regular Contributor
I am using the attribute inspector to try and edit a point feature class. I am getting some errors currently.
Onload:
[ATTACH=CONFIG]17503[/ATTACH]
and after I change some of the attributes:
[ATTACH=CONFIG]17504[/ATTACH]
This error repeats (7) time per attribute changed or if I hit the save button

My proxy.config files appears to be functioning properly after I manualy set the location of the proxy file.

The funny part about the whole thing is the "delete" feature button deletes the feature with no problem. Do you have any suggestions on how to fix this?

I will happy attach my code if you want to look at it.

Thanks for your time.
0 Kudos
13 Replies
BrandonVan_Horn
Regular Contributor
Here is an updated link to my semifunctional page

http://gis.co.yavapai.az.us/SurveyMon/editor.htm
0 Kudos
by Anonymous User
Not applicable
Original User: jgravois

as soon as an edit is made in the attribute window a call to applyEdits is made which returns the following error

{"error":{"code":400,"message":"Unable to complete  operation.","details":["Invalid graphic features","Invalid parameters"]}}

if your draft field doesn't have a domain, why does it display a dropdown which concatenates several values?  is this because you have map symbology based on multiple fields?
0 Kudos
BrandonVan_Horn
Regular Contributor
jgravois,
Yes, I have map symbology on my draft field. I use a group for null and draft. This makes the symbol the same.
Should I get rid of the null values and try it again?
Thanks for your response.
0 Kudos
by Anonymous User
Not applicable
Original User: jgravois

i don't know what will be necessary to resolve the error, but i would recommend doing some testing directly in REST to try and determine specifically what will be required to push an update through.

i don't see a corresponding feature service up.  are you making live changes?
0 Kudos
BrandonVan_Horn
Regular Contributor
I just calced the null values to draft, and forgot to check the feature service when I restarted the service. It is up now.
0 Kudos
by Anonymous User
Not applicable
Original User: vanhornsky

I figured out why the error is echoing 7 times. I have 7 edit fields and I have a method "onattributechange" which applies edits to the fields. Thanks for your recomendation to check the REST. Is there any documentaion for this? I will give it a try that this afternoon. Thanks for your time.
0 Kudos
by Anonymous User
Not applicable
Original User: jgravois

relevant REST doc
http://resources.arcgis.com/en/help/rest/apiref/fsserviceedits.html

as a simple test, i queried your feature service for an object id that i knew (1707) and requested that it be returned as JSON
http://gis.co.yavapai.az.us/ArcGIS/rest/services/SurveyEditor/FeatureServer/0/query?objectIds=1707&o...

afterwards i was unable to copy/paste the feature as an update into applyEdits.  if you use updateFeatures in REST instead of applyEdits, the following error is returned

Error: -1, Description: Update for the object was not attempted. Object may not exist.


i haven't seen something like this before, but something is up with your service.
0 Kudos
BrandonVan_Horn
Regular Contributor
Thanks for looking into this problem. I have been working on it for a week now. I am completly stumped!
0 Kudos
by Anonymous User
Not applicable
Original User: jgravois

i made a mistake earlier and tried to use updateFeature in REST pasting your JSON into one of our sample services, so the error i mentioned above is actually user error.  i tested again and was able to update a feature successfully using that approach.

afterward, i adapted our attribute inspector sample to use your data and its working just fine (i noticed that posts require a proxy).

http://jsfiddle.net/jagravois/2yAZe/

i'm not sure i understand what you're doing onAttributeChange
why write the feature to JSON?

why load both the editor widget and the attribute inspector?
are you confident that your implementation of the undomanager isn't causing the problem?

a good way to check would be to try updating the feature without the callback

SurveyMonumentsFL.applyEdits(null, [feature], null);
0 Kudos