kirill_lykov

How to handle add feature event in the FeatureLayer and Editor

Discussion created by kirill_lykov on May 3, 2011
I use a FeatureLayer created from the featureCollection. I also use esri.dijit.editing.Editor to add a feature to the map. Every time feature has been added to this layer I want to send it to my remote service using rest API. I tried to use FeatureLayer's onEditsComplete event:
dojo.connect(this._mapwrapper._operationalFLayer, "onEditsComplete", function(edits, updates, deletes) {
    var xhrArgs = {
            url: "http://XXXX/add",
            handleAs: "json",
            preventCache: true,
            content: {
                geometry: "....",
                text: "...."
            }
        };
     dojo.xhrGet(xhrArgs);
});

But it fires before user has entered information in the dialog created when user clicks on the map. So it seems useless. Do you know how to specify that mentioned action shall be done after user entered text in the editor's dialog?

Outcomes