jshanahan-esriaustralia-com-au-esridist

nLayersAddResult not being successful

Discussion created by jshanahan-esriaustralia-com-au-esridist on Oct 8, 2012
Latest reply on Oct 9, 2012 by jshanahan-esriaustralia-com-au-esridist
I have the onLayersAddResult setup  as follows


dojo.connect(map, "onLayersAddResult", initEditing,initEditingError);

I have setup the two callback functions

    function initEditing(results) {
      console.log("init initEditing");       
      var featureLayerInfos = dojo.map(results, function(result) {         
       return {'featureLayer': result.layer};
       }
       );       
}

function initEditingError(err){
  console.log("Init editing error")
  console.log(err);

}


I am only loading one layer so the event to set it going is as follows

var featureLayer = new esri.layers.FeatureLayer("http://lap-303754:6080/arcgis/rest/services/Birds/Birdsightings/FeatureServer/0",{
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,         
outFields: ["*"] });       

map.addLayers([featureLayer]);


However it in not being called correctly and the initEditingError method is being called.

err outputs the following to the console
error = undefined, more information here would be helpful
layer all of the layer attributes, can't see anything wrong here
success = true which implies according to esri help the layer was added successfully.

Any ideas why will it not call initEditing.
The service appears to be setup correctly and I have reworked my javascript to come at this from various angles.

Thanks
Joseph Shanahan
ESRI Australia

Outcomes