AnsweredAssumed Answered

FeatureLayer setEditable() not honored after layer is loaded

Question asked by dcastano on Mar 14, 2013
Latest reply on Mar 15, 2013 by dcastano
In my current application I load various FeatureLayers that I use for managing an edit environment.  I recently had a need to implement the FeatureLayer.setEditable(editable) and FeatureLayer.isEditable() methods to override the FeatureService capablilities. 

When the application starts, I obtain paramater information from a config object that indicates if the desired FeatureLayer is editable. This functionality is based on custom application business logic.  In the FeatureService the layer is editable but I assume that I can use the FeatureLayer.setEditable(editable) method to override the edit state so I can control when a specific FeatureLayer is editable by the user.  When I instantiate the FeatureLayer I set the FeatureLayer.setEditable(false).  I am able to review the object prior to it loading and it appears as though the _editable state = false (see image below).  After the layer is added to the map using map.addLayers() the _editable property is RESET back to true. It appears to me like it is not honoring any current edit state but rather using the edit state based on the Feature Service capabilities. 

Isn't the intent of the FeatureLayer.setEditable(editable) method to override the edit state?  Am I implementing it incorrectly? 

I know that I can go back ...loop through my edit layers within the "onLayersAddResult" handler and reset the property but that means more code.  Also, when I set the editable state, I have the object that I need at the moment that I instantiate the FeatureLayer (prior to it being added to the map.


Thanks for your time.