Select to view content in your preferred language

Feature edition errors

1160
6
Jump to solution
12-28-2012 01:10 AM
ab1
by
Deactivated User
Hello,
I've created a feature editor, of a puntual feature layer, in a flex 3.1 client. The feature layer is served by a feature service in ArcGIS Server 10.0.
When I try to update or delete features (I didn't try creation), I get errors eventhough the changes are made in the database.
The errors are like these :
TypeError: Error #1009: Il est impossible d'accéder à la propriété ou à la méthode d'une référence d'objet nul.  at com.esri.ags.components::Editor/saveUnsavedAttributes()  at com.esri.ags.components::Editor/attributeInspector_saveFeatureHandler()  at flash.events::EventDispatcher/dispatchEventFunction()  at flash.events::EventDispatcher/dispatchEvent()  at mx.core::UIComponent/dispatchEvent()  at com.esri.ags.components::AttributeInspector/dispatchSaveFeatureEvent()  at Function/http://adobe.com/AS3/2006/builtin::apply()  at mx.core::UIComponent/callLaterDispatcher2()  at mx.core::UIComponent/callLaterDispatcher()   TypeError: Error #1009: Il est impossible d'accéder à la propriété ou à la méthode d'une référence d'objet nul.  at com.esri.ags.components::Editor/featureLayer_editsCompleteHandler()  at flash.events::EventDispatcher/dispatchEventFunction()  at flash.events::EventDispatcher/dispatchEvent()  at mx.core::UIComponent/dispatchEvent()  at com.esri.ags.layers::FeatureLayer/http://www.esri.com/2008/ags/internal::editHandler()  at mx.rpc::AsyncResponder/result()  at com.esri.ags.tasks::FeatureLayerTask/handleApplyEdits()  at Function/http://adobe.com/AS3/2006/builtin::call()  at com.esri.ags.tasks::BaseTask/handleResultEvent()  at mx.rpc::AsyncResponder/result()  at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()  at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()  at HTTPOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()  at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()  at mx.rpc::Responder/result()  at mx.rpc::AsyncRequest/acknowledge()  at DirectHTTPMessageResponder/completeHandler()  at flash.events::EventDispatcher/dispatchEventFunction()  at flash.events::EventDispatcher/dispatchEvent()  at flash.net::URLLoader/onComplete()


In the code I have declared the editor inside the <fx:Declarations> along with a geometry service:
<esri:Editor id="mainEditor" map="{mainMap}" geometryService="{geometryService}" />


And I assigned the following method to 'initialize' attribute of the application:
protected function application_initializeHandler(event:FlexEvent):void    {     mainEditor.featureLayers = [arrets];         }

where "arrets" is the name of the feature layer I want to edit.

Do you have any idea of why the errors appear?

Regards.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Layachi,

   Then you need to look at the Edit without editor sample.

http://resources.arcgis.com/en/help/flex-api/samples/01nq/01nq00000043000000.htm

Or Just set the editors visibility to false.

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus
Layachi,

   Can you show how your are adding your layer in your code? Does your FeatureLayers url end with FeatureServer/# ? Is the layer you are attempting to edit coming for an SDE enterprise geodatabase?
0 Kudos
ab1
by
Deactivated User

   Can you show how your are adding your layer in your code?

<esri:FeatureLayer id="arrets" url="http://serverIP:8399/arcgis/rest/services/myService/FeatureServer/0" />



Is the layer you are attempting to edit coming for an SDE enterprise geodatabase?

Yes, it's coming from a SDE geodatabase.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Layachi,

   If your editor is NOT suppose to be in your declarations section as it is a visual component.
0 Kudos
ab1
by
Deactivated User
Thank you Robert for your answers.

I don't want any visual editor. Because of that I put it in the declaration section.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Layachi,

   Then you need to look at the Edit without editor sample.

http://resources.arcgis.com/en/help/flex-api/samples/01nq/01nq00000043000000.htm

Or Just set the editors visibility to false.
0 Kudos
ab1
by
Deactivated User
I put the editor inside a window and put visible="false".
=> I get no errors.

Thanks Robert 🙂
0 Kudos