feature.attributes={OBJECTID:gr.attributes.OBJECTID, RESP_PERQ:strRespPerq, RESULT:strResultatF, NBR_PLANTS:strNbrPlant, RAISON:strRaison, CONFUSION:strConfusion}; featureLayerFiche.applyEdits(null, [feature], null, new AsyncResponder(onResult, onFault)); function onResult():void { Alert.show("ONRESULT"); } function onFault(info:Object, token:Object = null):void { Alert.show(info.toString()); } // LOAD OF CODE ... // <esri:FeatureLayer id="featureLayerFiche" mode="snapshot" outFields="[OBJECTID, IDFICHE, NM_MUN, UNITE, DISTRICT, DATEFICHE, RESP_PERQ, DATE_PERQ, RESULT, NBR_PLANTS, RAISON, CONFUSION]" selectionComplete="myFeatureLayer_selectionCompleteHandler(event)" editsComplete="featureLayerFiche_EditsCompleteHandler" editsStarting="featureLayerFiche_EditsStartingHandler" fault="featureLayerFiche_FaultHandler" disableClientCaching="true" url="http://myserver123/ArcGIS/rest/services/geocisaille/FeatureServer/1"/> // LOAD OF CODE ... //
Solved! Go to Solution.
Hello everyone,
I'm currently trying to update a feature layer without attribute inspector (gave up with the attribute inspector / editor since I had no control over it for the interface).
My first problem is the following :
I have an error with my applyEdits : Invalid graphic features, Invalid parameters
And I just found out why, it's because one of my field is a date with a format like 2012/06/13 04:00:00 UTC and I was trying to update it with a 2010-01-01 format.
My second problem is the following :
So without the date, the applyEdits goes into the onResult but, no changes have been made to the feature layer and it doesn't even trigger the editComplete nor editsStarting events from the feature layer.
Here's the code :feature.attributes={OBJECTID:gr.attributes.OBJECTID, RESP_PERQ:strRespPerq, RESULT:strResultatF, NBR_PLANTS:strNbrPlant, RAISON:strRaison, CONFUSION:strConfusion}; featureLayerFiche.applyEdits(null, [feature], null, new AsyncResponder(onResult, onFault)); function onResult():void { Alert.show("ONRESULT"); } function onFault(info:Object, token:Object = null):void { Alert.show(info.toString()); } // LOAD OF CODE ... // <esri:FeatureLayer id="featureLayerFiche" mode="snapshot" outFields="[OBJECTID, IDFICHE, NM_MUN, UNITE, DISTRICT, DATEFICHE, RESP_PERQ, DATE_PERQ, RESULT, NBR_PLANTS, RAISON, CONFUSION]" selectionComplete="myFeatureLayer_selectionCompleteHandler(event)" editsComplete="featureLayerFiche_EditsCompleteHandler" editsStarting="featureLayerFiche_EditsStartingHandler" fault="featureLayerFiche_FaultHandler" disableClientCaching="true" url="http://myserver123/ArcGIS/rest/services/geocisaille/FeatureServer/1"/> // LOAD OF CODE ... //
So I'm just wondering why it doesnt trigger my events if it went into the onResult function.
*Also, I tried to place the [feature] in the delete array and it works, so I can delete feature with no problem.*
Any help would be greatly appreciated, since there's not alot of docs about it.
Lmk if you need more informations.
Just a wild guess here. I would assume that you using the AsyncResponder overrides the edits complete event for the feature layer.
Have you tried just doing featureLayerFiche.applyEdits(null, [feature], null); That is how I do it outside of the attribute inspector, and it works everytime.
Sacha,
You can change the UI of the components by customizing their skins. See:
http://resources.arcgis.com/en/help/flex-api/concepts/index.html#/Styling_and_skinning_overview/017p...
You can update a date field by making the attribute value be a Date or a Number.
You should be getting the events whether you use a responder or not. Are you testing with a debug Flash Player? If not, you won't see the any runtime errors.
The onResult signature should be like:
function myResultFunction(result:Object, token:Object = null):void
You can also type the result as a FeatureEditResults class. You can check each FeatureEditResult to see if "success" is true or not. You can also use a tool like HttpFox or Charles Proxy to watch the network traffic and see what the response from the server is.
This sample may be helpful:
http://resources.arcgis.com/en/help/flex-api/samples/index.html#/Edit_without_Editor/01nq00000043000...
I'd double-check the request to make sure the right object id is being sent.
Does it work with the Editor component? See:
http://resources.arcgis.com/en/help/flex-api/samples/index.html#/Default_Editor/01nq0000001r000000/
If yes, what is the difference in the HTTP requests?