Feature creation is disabled for all layers. Why?

5321
3
07-06-2012 06:19 AM
KirkWebb
New Contributor III
I have an extensively developed Javascript api application that incorporates popups, nav tools, identify tool, measure etc. I am trying to incorporate the 'Default Editing Widget' into this application.  Everything came together well except my template picker pane displays the message "Feature creation is disabled for all layers".

I would normally look to my Feature service to try and find problems there first.  However, before I tried incorporating the widget code into my developed application I added my feature service to the basic source code as provided in the samples on the ArcGIS javascript site and created an application with just editing functionality and it works perfectly so I know there is nothing wrong with my feature service.



What could be the problem causing feature creation to be disabled?

Any help is greatly appreciated.
Thanks
0 Kudos
3 Replies
derekswingley1
Frequent Contributor
You've set up four callbacks to run when onLayersAddResult ... I imagine your initEditing function isn't getting a reference to your editable layers. I recommend using a single callback for onLayersAddResult, filter your layers in your callback and then set up your various widgets.
0 Kudos
KirkWebb
New Contributor III
Hi,
I see what you mean about the 4 callbacks.


You wrote, "I recommend using a single callback for onLayersAddResult, filter your layers in your callback and then set up your various widgets. "

I don't think I have seen this before.  How could I consolidate into a single callback?  Could you show a little snippet of code example?

Thanks,
0 Kudos
derekswingley1
Frequent Contributor
Here's a high level overview:
�??create a few arrays:  one with layer ID's for editing, one with layer ID's for your legend, one that contains all of your layers
�??pass the array of all layers to map.addLayers
�??in the callback, use dojo.filter to create new arrays of layers you can pass to the Editor widget and the Legend widget by checking if a layer's ID is in the editing array or the legend array
0 Kudos